using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;

namespace AutoTurnOver.Utility
{
    public class Security
    {
        /// <summary>
        /// MD5　32位加密
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static string md5Encrypt(string encryptString)
        {
            MD5 md5 = new MD5CryptoServiceProvider();
            byte[] data = md5.ComputeHash(Encoding.UTF8.GetBytes(encryptString));
            string sb = "";
            for (int i = 0; i < data.Length; i++)
            {
                sb += Convert.ToString(data[i], 16).PadLeft(2, '0');
            }
            sb = sb.PadLeft(32, '0');
            return sb;
        }
    }

}
