SHA1 hash question

Posted by phenevo on Stack Overflow See other posts from Stack Overflow or by phenevo
Published on 2010-02-26T13:54:00Z Indexed on 2010/05/31 7:23 UTC
Read the original article Hit count: 471

Filed under:
|

Hi,

I have this method to hash a string:

 byte[] buffer = enc.GetBytes(text);
 SHA1CryptoServiceProvider cryptoTransformSHA1 =
                new SHA1CryptoServiceProvider();
 string hash = BitConverter.ToString(
                cryptoTransformSHA1.ComputeHash(buffer)).Replace("-", "");

 return hash;

My question is:

Is the resulting hash always the same for the same string?

I hashed a string a couple of days ago and it seems that it now resulted in another hash, but i'm not sure.

© Stack Overflow or respective owner

Related posts about c#

Related posts about sha1