标签:
static class StringEx { public static string MD5(this String str) { byte[] bytes = new MD5CryptoServiceProvider().ComputeHash(Encoding.UTF8.GetBytes(str)); string result = String.Empty; for (int i = 0; i < bytes.Length; i++) { result += bytes[i].ToString("x").PadLeft(2, ‘0‘); } return result; } }
标签:
原文地址:http://www.cnblogs.com/bruceleeliya/p/4203416.html