SHA1 length of resulting hash

  • Thread starter Dil via .NET 247
  • Start date
D

Dil via .NET 247

Fresher to .NET

Aiming to produce a resulting hash of length 24 CHARACTERS, using MD5 or SHA1 Algorithms.
According to the Class Libraries, the hash size for the SHA1 algorithm is 160 bits, and 128 bits for MD5.

After generating the hash, I convert the byte result to a base64 String, and my resulting hash lengths are as below:

MD5 - 24 characters
SHA1 - 28 Characters

Please can someone confirm that this is correct, as I am a little confused in believing that the MD5 hash length should be 16 characters (128 bits) and the SHA1 hash length should be 20 (160 bits) characters long.

Is it possible to produce a hash length of a REQUIRED length size, without trimming the result of the hash?
Is the conversion to base64 String correct?


Would most appreciate any assistance and comments.
Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

sha1/base64 4
SHA1 1
SHA1 4
Maximum length of array#hash 6
shorten SHA1-hash 1
Length of the data to decrypt is invalid 0
MD5 Checksum of a String 2
Hash Function (str -> 32 bits) 6

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top