首页 > 其他 > 详细

32位MD5加密补齐丢失的0

时间:2017-11-18 15:55:48      阅读:633      评论:0      收藏:0      [点我收藏+]
        

     /// <summary> /// 获取32位MD5加密字符串(已补完0) /// </summary> /// <param name="strWord"></param> /// <returns></returns> public static string GetMD5String(string strWord) { string strRes = string.Empty; MD5 md5 = MD5.Create(); byte[] fromData = System.Text.Encoding.UTF8.GetBytes(strWord); byte[] targetData = md5.ComputeHash(fromData); for (int i = 0; i < targetData.Length; i++) { strRes += targetData[i].ToString("x2");//x不补0,x2把0补齐,X为大写 } return strRes; }

 

32位MD5加密补齐丢失的0

原文:http://www.cnblogs.com/maojunyi/p/7856827.html

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