天天看点

C#生成32位MD5加密

Code
string str = "admin1235";   //要加密的字符串  
System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create();
byte[] bytStr = md5.ComputeHash(Encoding.UTF8.GetBytes(str));
string encryptStr = "";
for (int i = 0; i < bytStr.Length; i++)
{
    encryptStr = encryptStr + bytStr[i].ToString("x").PadLeft(2, '0');
}
MessageBox.Show(encryptStr);      

转载于:https://www.cnblogs.com/dongqiliang/archive/2008/12/06/1349007.html

c#