add
zongzhibin
2024-11-24 59575fe77af455478e81dff65e2e5e6979fdf7f6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Security.Cryptography;
using System.Text;
 
namespace iWareCommon.Utils
{
    public class MD5Helper
    {
        public static string ParseMd5(string pwd)
        {
            
            var md5 = new MD5CryptoServiceProvider();            
            var bytes = Encoding.UTF8.GetBytes(pwd);
            bytes = md5.ComputeHash(bytes);
            md5.Clear();
 
            string ret = "";
            
            for(int i=0; i < bytes.Length; i++)
            {                
                ret += Convert.ToString(bytes[i],16).PadLeft(2,'0');
            }
  
            return ret.PadLeft(32,'0');
        }
 
 
 
    }
}