























/// <summary>
/// md5加密算法
/// </summary>
/// <param name="strIN"></param>
/// <returns></returns>
private string MD5Encrypt(string strIN)
{
System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] bytValue, bytHash;
bytValue = System.Text.Encoding.UTF8.GetBytes(strIN);
bytHash = md5.ComputeHash(bytValue);
md5.Clear();
string sTemp = "";
for (int i = 0; i < bytHash.Length; i++)
{
sTemp += bytHash[i].ToString("x").PadLeft(2, '0');
}
if (sTemp.Length > 32)
{
sTemp = sTemp.Substring(0, 32);
}
return sTemp;
}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。