• C# 32位16进制加密


    项目中用到记录一下,以下方法密码生成32位,如果使用toString("X"),发现生成的有时30位大写,有时31位,所以注意使用X2, 如果小写,使用小写的 x2

     /// <summary>
            /// MD5 32位加密
            /// </summary>
            /// <param name="str"></param>
            /// <returns></returns>
            public static string UserMd5(string str)
            {
                using (MD5 mi = MD5.Create())
                {
                    byte[] buffer = Encoding.Default.GetBytes(str.Trim());
                    //开始加密
                    byte[] newBuffer = mi.ComputeHash(buffer);
                    StringBuilder sb = new StringBuilder();
                    for (int i = 0; i < newBuffer.Length; i++)
                    {
                        sb.Append(newBuffer[i].ToString("X2"));
                    }
                    return sb.ToString();
                }
            }
  • 相关阅读:
    SQL SEREVR IO
    INTEL
    windows performance
    The DiskSpd Storage Performance Tool
    machine Learning
    NOSQL
    X64 Deep Dive
    Debugging and performance,ETW
    Disk Performance
    WCF transport-and-message-security
  • 原文地址:https://www.cnblogs.com/lunawzh/p/14957374.html
Copyright © 2020-2023  润新知