其他常用方法详见:https://www.cnblogs.com/zhuanjiao/p/12060937.html
/// <summary> /// 32位MD5加密(小写) /// </summary> /// <param name="input">输入字段</param> /// <returns></returns> public string Encrypt(string str) { MD5CryptoServiceProvider md5Hasher = new MD5CryptoServiceProvider(); byte[] data = md5Hasher.ComputeHash(Encoding.Default.GetBytes(str)); StringBuilder sBuilder = new StringBuilder(); for (int i = 0; i < data.Length; i++) { sBuilder.Append(data[i].ToString("x2"));//转化为小写的16进制 } return sBuilder.ToString(); }
原文地址:https://www.cnblogs.com/zhuanjiao/p/12092632.html
时间: 2024-10-10 16:30:12