zoukankan      html  css  js  c++  java
  • MD5 加密 字符串

         //获取字符串的MD5码
            public  string CreateMD5Hash(string input)
            {
                // Use input string to calculate MD5 hash
                System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create();
                byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input);
                byte[] hashBytes = md5.ComputeHash(inputBytes);
    
                // Convert the byte array to hexadecimal string
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < hashBytes.Length; i++)
                {
                    sb.Append(hashBytes[i].ToString("X2"));
                    // To force the hex string to lower-case letters instead of
                    // upper-case, use he following line instead:
                    // sb.Append(hashBytes[i].ToString("x2")); 
                }
                return sb.ToString();
            }
  • 相关阅读:
    ➡️➡️➡️IELTS reading by Simon on Bili
    lc0502
    lc0331
    lc0329
    lc0327
    lc0326
    lc0324
    lc0320
    lc0319
    lc0316
  • 原文地址:https://www.cnblogs.com/qc-id-01/p/9922748.html
Copyright © 2011-2022 走看看