美文网首页
C# MD5加密

C# MD5加密

作者: a9b854aded01 | 来源:发表于2017-11-06 09:48 被阅读0次

    public class Encrypt
    {
    public string Encrypt_MD5(string password)
    {
    System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
    byte[] result = Encoding.Default.GetBytes(password);
    byte[] output = md5.ComputeHash(result);
    StringBuilder sb = new StringBuilder();
    for(int i= 0; i < output.Length; i++)
    {
    sb.Append(output[i].ToString("x"));
    }
    return sb.ToString().ToLower();
    }
    //安卓 “123” “202cb962ac59075b964b07152d234b70”
    }

    相关文章

      网友评论

          本文标题:C# MD5加密

          本文链接:https://www.haomeiwen.com/subject/zgbkmxtx.html