using System.Text;
using System;
using System.Security.Cryptography;

namespace JiaZhiQuan.Common.Utils {
    public class EncryptUtils {
        /// <summary>
        /// md5加密
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public static string Md5Encrypt(string input) {
            using var md5 = MD5.Create();
            byte[] hashBytes = md5.ComputeHash(Encoding.UTF8.GetBytes(input));
            return BitConverter.ToString(hashBytes);
        }
        public static string Md5EncryptTolower(string input) {
            return Md5Encrypt(input).Replace("-", string.Empty).ToLower();
        }
    }
}
