S
S
SankaSanka2021-11-22 10:17:13
Java
SankaSanka, 2021-11-22 10:17:13

How to make the correct hash from a string?

I have a string of 128 zeros and ones.

here is the calculator. https://cryptii.com/
I need to translate it using JAVA in this way.
619b44466761b214062320.png
and get the output as a text string
Exactly so, and not just as a text to encrypt.

please tell me how to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
megusius, 2021-11-24
@megusius

When converting an incoming bitset to a BigInteger, the leading bytes are lost if they are 0 (00000000 in bit representation).
Example:
Enter two bytes (a space is inserted for readability): 00000000 00000001
We expect byte [] data to contain {0 , 1}
In fact, byte [] data contains {1}, because new BigInteger(noliki, 2) will be equal to 1 and when converted toByteArray() will return {1}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question