//输入密码
public static string CreateMD5HashCode(string inputString)
{
byte[] data = MD5.Create().ComputeHash(Encoding.Default.GetBytes(inputStri ng));
//创建MD5
StringBuilder dataBuffer = new StringBuilder();
for (int i = 0; i < data.Length; i++)
{
dataBuffer.Append(data[i].ToString("X2"));
}
//加密
return dataBuffer.ToString();
//输出
}
网友评论