首页 > Windows开发 > 详细

C#NET获取CalculateMD5Hash32位

时间:2020-03-04 22:37:15      阅读:82      评论:0      收藏:0      [点我收藏+]
1         public string CalculateMD5Hash(string input)
2         {
3             MD5 md5 = MD5.Create();
4             byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input);
5             byte[] hash = md5.ComputeHash(inputBytes);
6             StringBuilder sb = new StringBuilder();
7             for (int i = 0; i < hash.Length; i++) { sb.Append(hash[i].ToString("X2")); }
8             return sb.ToString();
9         }

 

C#NET获取CalculateMD5Hash32位

原文:https://www.cnblogs.com/wz2988/p/12416513.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!