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.
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.