C#MD5算法

public static string GetMD5(string str, string encoding)
{
  MD5CryptoServiceProvider MD5 = new MD5CryptoServiceProvider();
  string result =BitConverter.ToString(MD5.ComputeHash(Encoding.GetEncoding(encoding).GetBytes(str))).Replace("-", "");
  return result;
}

猜你喜欢

转载自www.cnblogs.com/wenhaiw/p/12175842.html