1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
public string CreateMD5Hash (string input)
{
MD5 md5 = System.Security.Cryptography.MD5.Create();
byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes (input);
byte[] hashBytes = md5.ComputeHash (inputBytes);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hashBytes.Length; i++)
{
sb.Append (hashBytes[i].ToString ("X2"));
}
return sb.ToString();
}
|