标签:odi bytes clear ++ int new turn compute 字节序
private string Encrypt(string strpsw)
{
MD5 md5 = new MD5CryptoServiceProvider();
Byte[] data = System.Text.Encoding.Default.GetBytes(strpsw); //将字符编码为一个字节序列
byte[] md5data = md5.ComputeHash(data); //计算data字节数组的哈希值
md5.Clear();
string str = "";
for (int i = 0; i < md5data.Length - 1; i++)
{
str += md5data[i].ToString("X").PadLeft(2, ‘0‘);
}
return str;
}
标签:odi bytes clear ++ int new turn compute 字节序
原文地址:http://www.cnblogs.com/suyichen/p/6409194.html