共计 282 个字符,预计需要花费 1 分钟才能阅读完成。
private string SHA1(string str)
{byte[] strRes = Encoding.Default.GetBytes(str);
HashAlgorithm iSha = new SHA1CryptoServiceProvider();
strRes = iSha.ComputeHash(strRes);
StringBuilder enText = new StringBuilder();
foreach (byte iByte in strRes)
{enText.AppendFormat("{0:x2}", iByte);
}
return enText.ToString();}
正文完