Hashing a string value using SHA1 algorithm
Hi guys...
Very very urgent!!
I am trying to Hash the string 'Test' and then converting it to base64string, but some how I am having a doubt that if this is running correct.
Please copy the code below and run the code, tell me the return param or value of 'Output' variable. I have written down the result on my system kindly compare the same on ur system and update me if the result is the same or not. Kindly update me at the earliest
string Input;
string Output;
Input = "Test";
System.Security.Cryptography.SHA1 sha1 = System.Security.Cryptography.SHA1.Create();
byte[] hash = sha1.ComputeHash(System.Text.Encoding.UTF8.GetBytes(Input ));
Output = Convert.ToBase64String(hash);
MessageBox.Show(Output);
//Output: ZAqyuuB77cTBY/Z5p0b3q3+10fo=
Thankyou,
Praveen
Re: Hashing a string value using SHA1 algorithm
I got ZAqyuuB77cTBY/Z5p0b3q3+10fo=
Dan
Re: Hashing a string value using SHA1 algorithm
Hi Dan,
Thankx for testing the code... and also the problem has been rectified. Thank you once again.
Regards,
Praveen