publicstaticstring GetPasswordHash(string password)
{
byte[] _bytePassword = ASCIIEncoding.ASCII.GetBytes(password.Trim());
_bytePassword = new SHA1CryptoServiceProvider().ComputeHash(_bytePassword);
//do convert it to string for display & storing in DB
int i;
StringBuilder sbOutput = new StringBuilder(_bytePassword.Length);
for (i = 0; i < _bytePassword.Length - 1; i++)
{
//build string array from byte array
sbOutput.Append(_bytePassword[i].ToString("X2"));//"X2" is used to convert byte array to string
}
return sbOutput.ToString();
}