Net MD5
using System.Security.Cryptography;
/// <summary> /// MD5散列 /// </summary> public static string MD5(this string inputStr) { MD5 md5 = new MD5CryptoServiceProvider(); byte[] hashByte = md5.ComputeHash(Encoding.UTF8.GetBytes(inputStr)); StringBuilder sb = new StringBuilder(); foreach (byte item in hashByte) sb.Append(item.ToString("x").PadLeft(2, '0')); return sb.ToString(); }