c# - SHA512Managed hashSize -


The official document of MSDN says

Hashem size 512 for SHA512 managed algorithms Bit is

When I run the following code

  byte [] datatouccode = encoding.utf 8.getbits ("hello world"); SHA512 Managed Sha = New SHA512 Managed (); Byte [] hashed data = sha.ComputeHash (dataToEncode); String hashed datastring = convert Tobase 64 string (hasheddata);   

My HasheDataString is only 64 long (hashed data string.line) and hashed data is only 64 lenght (hashdata lang). What exactly is this 512?

Each byte has eight bits, 64 bytes are 64 * 8 = 512 bits.

The 6464 encoded string of 6464 bytes is 88 characters long. Base 64 encoding stores are six bits in each character, so 512 bits require 512/6 ~ 85.3 characters, as well as two additional characters to reach the four-character limit.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -