C#中使用MD5加密
1: public string CreateMD5(string inputStr)
2: {
3: MD5 md5 = MD5.Create();
4: byte[] byteChar = md5.ComputeHash(Encoding.Default.GetBytes(inputStr));
5:
6: StringBuilder sb = new StringBuilder();
7: foreach (byte b in byteChar)
8: {
9: sb.Append(b.ToString("x2"));
10: }
11: return sb.ToString();
12: }