标签:
string HmacMD5(string source, string key) { HMACMD5 hmacmd = new HMACMD5(Encoding.Default.GetBytes(key)); byte[] inArray = hmacmd.ComputeHash(Encoding.Default.GetBytes(source)); StringBuilder sb = new StringBuilder(); for (int i = 0; i < inArray.Length; i++) { sb.Append(inArray[i].ToString("X2")); } hmacmd.Clear(); return sb.ToString(); }
需 引用命令空间System.Security.Cryptography
标签:
原文地址:http://www.cnblogs.com/szfhquan/p/5912215.html