第1个回答 2012-06-05
public static string GetMD5HashHex(String input)
{
MD5 md5 = new MD5CryptoServiceProvider();
DES des = new DESCryptoServiceProvider();
byte[] res = md5.ComputeHash(Encoding.Default.GetBytes(input), 0, input.Length);
String returnThis = "";
for (int i = 0; i < res.Length; i++)
{
returnThis += System.Uri.HexEscape((char)res[i]);
}
returnThis = returnThis.Replace("%", "");
returnThis = returnThis.ToLower();
return returnThis;
}