C#中MD5加密
发布时间:2015-12-28 18:00:15
1 using System.Security.Cryptography; 2 using System.Text; 3 4 namespace Common 5 { 6 public class Md5Helper 7 { 8 public string Ge ...
1 using System.Security.Cryptography; 2 using System.Text; 3 4 namespace Common 5 { 6 public class Md5Helper 7 { 8 public get='_blank'>string GetMd5(string txt) 9 {10 //创建md5对象11 MD5 md5 = MD5.Create();12 //将字符串转成字节数组13 byte[] bs = Encoding.UTF8.GetBytes(txt);14 //加密15 byte[] bs2 = md5.ComputeHash(bs);16 //将字节数组转成字符串17 StringBuilder sb = new StringBuilder();18 for (int i = 0; i < bs2.Length; i++)19 {20 sb.Append(bs2[i].ToString("X2")); //x小写X大写21 }22 return sb.ToString();23 }24 }25 }
原标题:C#中MD5加密
关键词:C#
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。
国内空运托运:https://www.goluckyvip.com/tag/102802.html
安庆市空运:https://www.goluckyvip.com/tag/102803.html
空运快递有哪些:https://www.goluckyvip.com/tag/102804.html
柳州空运:https://www.goluckyvip.com/tag/102805.html
行李空运:https://www.goluckyvip.com/tag/102806.html
fra空运:https://www.goluckyvip.com/tag/102807.html
37号文今后是否会更新?一文详解关键信息 :https://www.kjdsnews.com/a/1836441.html
探讨内地人开设香港账户的可行性 :https://www.kjdsnews.com/a/1836442.html