`
cbting
  • 浏览: 57849 次
  • 性别: Icon_minigender_1
  • 来自: 汕头
社区版块
存档分类
最新评论

MD5 的摘要说明

    博客分类:
  • C#
阅读更多

/// <summary>
///MD5 的摘要说明
/// </summary>
public static class MD5
{
 
  public  static string GetMD5(string Input, bool Half)
    {
        string output = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(Input, "MD5").ToLower();
        if (Half)//16位MD5加密(取32位加密的6~22字符)
        {
            output = output.Substring(5, 16);
        }
        return output;
    }

    public static string GetMD5(string Input)
    {
        return GetMD5(Input, true);
    }
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics