如题
public static string MD5(string password)
{
byte[] textBytes = System.Text.Encoding.Default.GetBytes(password);
System.Security.Cryptography.MD5CryptoServiceProvider cryptHandler;
cryptHandler = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] hash = cryptHandler.ComputeHash(textBytes);
StringBuilder ret = new StringBuilder(32);
foreach (byte a in hash)
{
if (a < 16)
ret.Append("0").Append(a.ToString("x"));
else
ret.Append(a.ToString("x"));
}
return ret.ToString();
}
原标签已从 2023-12-16 存档快照 恢复。本文按原站快照恢复排版,并接回已核实的本地图片。查看恢复说明