标签:hash service pre summary cep uil turn ash private
使用System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile进行MD5加密时,会出现已过时
1 /// <summary> 2 /// 32位MD5加密 3 /// </summary> 4 /// <param name="input"></param> 5 /// <returns></returns> 6 private static string Md5Hash(string input) 7 { 8 MD5CryptoServiceProvider md5Hasher = new MD5CryptoServiceProvider(); 9 byte[] data = md5Hasher.ComputeHash(Encoding.Default.GetBytes(input)); 10 StringBuilder sBuilder = new StringBuilder(); 11 for (int i = 0; i < data.Length; i++) 12 { 13 sBuilder.Append(data[i].ToString("x2")); 14 } 15 return sBuilder.ToString(); 16 }
标签:hash service pre summary cep uil turn ash private
原文地址:https://www.cnblogs.com/Loners/p/10180491.html