标签:build private hash creat uil str stringbu ash encoding
private static string GetMd5String(string msg) { StringBuilder sb = new StringBuilder(); using(MD5 md5 = MD5.Create()) { byte[] bytes = Encoding.UTF8.GetBytes(msg); byte[] md5Byte = md5.ComputeHash(bytes); for (int i = 0; i < md5Byte.Length; i++) { sb.Append(md5Byte[i].ToString("x2")); } } return sb.ToString(); }
标签:build private hash creat uil str stringbu ash encoding
原文地址:http://www.cnblogs.com/mathyk/p/7103742.html