Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   SHA1 length of resulting hash (http://www.velocityreviews.com/forums/t84161-sha1-length-of-resulting-hash.html)

Dil via .NET 247 08-04-2004 12:53 PM

SHA1 length of resulting hash
 
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.
----------------------------
From: Dil

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>ab2i+C4Ps0SnN8ud3RR4Qg==</Id>


All times are GMT. The time now is 09:21 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.