MD5加密过时方法替换
程序员文章站
2022-07-04 11:03:05
使用System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile进行MD5加密时,会出现已过时 ......
使用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 }
上一篇: 云南哪里最好玩 云南必去景点
下一篇: JS中如何理解浮点数?