/*将字符串转utf8 byte[]数组。*/ public class MD5Helper { public static string Encrypt(string str) { string encryptStr = string.Empty; MD5 md5 = MD5.Create(); byte[] buffer = md5.ComputeHash(Encoding.UTF8.GetBytes(str)); foreach (var b in buffer) { encryptStr += b.ToString("X"); } return encryptStr; } }
原文地址:https://www.cnblogs.com/pltlfy/p/10134123.html
时间: 2024-11-15 00:26:47