SHA1 length of resulting hash

Discussion in 'ASP .Net' started by Dil via .NET 247, Aug 4, 2004.

  1. 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>
     
    Dil via .NET 247, Aug 4, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Al Murphy

    SHA1 hash generator in hex

    Al Murphy, Mar 2, 2004, in forum: Java
    Replies:
    5
    Views:
    28,041
    darkzak
    Jan 7, 2009
  2. =?iso-8859-1?q?Elmo_M=E4ntynen?=

    How can I get an sha1 hash in base32?

    =?iso-8859-1?q?Elmo_M=E4ntynen?=, Jul 23, 2005, in forum: Python
    Replies:
    2
    Views:
    1,047
    =?iso-8859-1?q?Elmo_M=E4ntynen?=
    Jul 24, 2005
  3. LMZ
    Replies:
    5
    Views:
    630
    Martin v. Löwis
    Apr 6, 2008
  4. Adam Tauno Williams
    Replies:
    2
    Views:
    920
    Stefan Behnel
    Dec 30, 2010
  5. rp
    Replies:
    1
    Views:
    593
    red floyd
    Nov 10, 2011
Loading...

Share This Page