C#MD5加密
2021-03-29 05:28
标签:create item pen ted utf8 enc end ash ext C#MD5加密 标签:create item pen ted utf8 enc end ash ext 原文地址:https://www.cnblogs.com/ruanxin/p/9308888.html protected string GetMd5String(string str)
{
MD5 md5 = MD5.Create();
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(str);
byte[] strBuffer = md5.ComputeHash(buffer);
StringBuilder sb = new StringBuilder();
foreach (byte item in strBuffer)
{
sb.Append(item.ToString("x2"));
}
return sb.ToString();
}