Thanks Hernan for your answer.
You pointed right the issue. The problem was my convert to hex value
with Convert.ToString(b, 16).
I have not tested your solution as I fixed the issue just before your
post

by using String.Format
Anyway I guess this can be relevant to other folks...
Here is the new code with
private string Hash(string toHash)
{
string hashed = "";
SHA1 sha1 = new SHA1CryptoServiceProvider();
byte[] hash =
sha1.ComputeHash(System.Text.Encoding.UTF8.GetByte s(toHash));
foreach(byte b in hash)
hashed += String.Format("{0,2:X2}", b);
return hashed;
}
Cheers
Julius
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!