标签:ash text compute public new bsp bytes get buffer
public static string GetMd5String(string str)
{
MD5 md5 = MD5.Create();
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(str);
byte[] md5Buffer = md5.ComputeHash(buffer);
StringBuilder sb = new StringBuilder();
foreach (byte b in md5Buffer)
{
sb.Append(b.ToString("x2"));//格式
}
return sb.ToString();
}
标签:ash text compute public new bsp bytes get buffer
原文地址:http://www.cnblogs.com/pangzhixing/p/6361179.html