数字签名算法(C#)

public static string GetSHA1Method(string strSource)
{
string strResult = "";

//Create
System.Security.Cryptography.SHA1 sha = System.Security.Cryptography.SHA1.Create();
byte[] bytResult = sha.ComputeHash(System.Text.Encoding.UTF8.GetBytes(strSource));
for (int i = 0; i < bytResult.Length; i++)
{
strResult = strResult + bytResult[i].ToString("X2");
}
return strResult;
}

原文地址:https://www.cnblogs.com/quietwalk/p/3530980.html