C#生成MD 5代码示例
//Use input string to calculate MD5 hash
MD5 md5=System.S ec urity.Cryptography.MD5.Create();byte[] inputByt es=Sys tem.Text.Enc oding.AS CII.GetBytes (input);byte[]has hBytes=md5.ComputeHas h(input Bytes);
//Convert the byte array to hexadec imal string
StringBuilder sb=new StringBuilder();for(int i=0; i hashBytes.Length; i++)sb.Append(hashBytes[i].ToString(“X2”));
//To force the hex string to lower-case letters instead of
//upper-case,use he following line instead:
//sb.Append(hashBytes[i].ToString(“x2”));return s b.ToS tring();
}
用法string md5hash=CreateMD5 Hash(“abc defghijklmnopqrstuvwxyz”);
执行结果md5hash will contain this string:“C3FCD3D76192E4007DFB496CCA67E13 B”.C#里也可以直接使用S y st em.Web.S ec ur ity命名空间生成MD 5
FormsAuthentic ation.HashPas swordForStoringInConfigFile(string, “MD5”)
易速互联怎么样?易速互联是国人老牌主机商家,至今已经成立9年,商家销售虚拟主机、VPS及独立服务器,目前商家针对美国加州萨克拉门托RH数据中心进行促销,线路采用BGP直连线路,自带10G防御,美国加州地区,100M带宽不限流量,月付299元起,有需要美国不限流量独立服务器的朋友可以看看。点击进入:易速互联官方网站美国独立服务器优惠套餐:RH数据中心位于美国加州、配置丰富性价比高、10G DDOS免...
photonvps怎么样?photonvps现在针对旗下美国vps推出半价促销优惠活动,2.5美元/月起,免费10Gbps DDoS防御,Linux系统,机房可选美国洛杉矶、达拉斯、芝加哥、阿什本。以前觉得老牌商家PhotonVPS贵的朋友可以先入手一个月PhotonVPS美国Linux VPS试试了。PhotonVPS允许合法大人内容,支持支付宝、paypal和信用卡,30天退款保证。Photo...
官方网站:点击访问ATCLOUD.NET官网优惠码:目前提供Cloud VPS与Storage VPS两款产品的六折优惠活动(续费同价,截止至2021年5月31日)优惠码:UMMBPBR20Z活动方案:一、型号CPU内存磁盘流量优惠价格购买链接VPS-1GB0.5×2.6+GHz1GB20GB1TB$3立即购买VPS-2GB1×2.6+GHz2GB50GB2TB$6立即购买VPS-4GB2×2.6...