c# MD5加密

  public class MD5
    {
        /// <summary>
        /// 加密
        /// </summary>
        /// <param name="encryptString">加密字符串</param>
        /// <returns></returns>
        public static string Encrypt(string encryptString)
        {
            var md5 = new MD5CryptoServiceProvider();
            var result = BitConverter.ToString(md5.ComputeHash(Encoding.UTF8.GetBytes(encryptString)), 4, 8);
            result = result.Replace("-", "");
            return result.ToLower();
        }
    }

 

posted @ 2018-05-08 10:08  紫晶城  阅读(119)  评论(0编辑  收藏  举报