62,025
社区成员
发帖
与我相关
我的任务
分享
public static string Hash(string toHash)
{
MD5CryptoServiceProvider crypto = new MD5CryptoServiceProvider();
byte[] bytes = Encoding.UTF7.GetBytes(toHash);
bytes = crypto.ComputeHash(bytes);
StringBuilder sb = new StringBuilder();
foreach (byte num in bytes)
{
sb.AppendFormat("{0:x2}", num);
}
return sb.ToString();
}