C# MD5 加密方法

1 public string md5( string str, int code)
2 {
3    if(code==16) //16位MD5加密(取32位加密的9~25字符)
4    {
5        return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str,"MD5").ToLower().Substring(8,16) ;
6    }
 
7    else//32位加密
8    {
9        return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str,"MD5").ToLower();
10    }
 
11}

12

猜你喜欢

转载自blog.csdn.net/wyz52126/article/details/7957230