ASP.NET-SHA256加密方法
2021-06-19 03:03
标签:static ati SHA256 encoding i++ from ret mst com /// byte[] retVal = sha256.ComputeHash(bytValue); ASP.NET-SHA256加密方法 标签:static ati SHA256 encoding i++ from ret mst com 原文地址:http://www.cnblogs.com/LiHeQ/p/7194097.html
/// SHA256加密
///
///
///
public static string GetSHA256HashFromString(string strData)
{
byte[] bytValue = System.Text.Encoding.UTF8.GetBytes(strData);
SHA256 sha256 = new SHA256CryptoServiceProvider();
StringBuilder sb = new StringBuilder();
for (int i = 0; i {
sb.Append(retVal[i].ToString("x2"));
}
return sb.ToString();
}
上一篇:AJAX
文章标题:ASP.NET-SHA256加密方法
文章链接:http://soscw.com/index.php/essay/95760.html