C# 标准的MD5加密32位
2021-06-21 10:05
标签:string ring text com md5加密 md5 crypto ide stat 标准的MD5加密32位小写的: C# 标准的MD5加密32位 标签:string ring text com md5加密 md5 crypto ide stat 原文地址:https://www.cnblogs.com/aijiao/p/10240366.html public static string GetMD5(string myString)
{
MD5 md5 = new MD5CryptoServiceProvider();
//byte[] fromData = System.Text.Encoding.Unicode.GetBytes(myString);
byte[] fromData = System.Text.Encoding.UTF8.GetBytes(myString);//
byte[] targetData = md5.ComputeHash(fromData);
string byte2String = null;
for (int i = 0; i )
{
byte2String += targetData[i].ToString("x");
}
return byte2String;
}