码迷,mamicode.com
首页 > Windows程序 > 详细

C# DM5 32位加密

时间:2016-02-20 11:39:26      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:

using System.Security.Cryptography;
using System.Text;

public static string StringToMD5Hash(string inputString)
        {
            MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
            byte[] encryptedBytes = md5.ComputeHash(Encoding.ASCII.GetBytes(inputString));
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < encryptedBytes.Length; i++)
            {
                sb.AppendFormat("{0:x2}", encryptedBytes[i]);
            }
            return sb.ToString();
        }

C# DM5 32位加密

标签:

原文地址:http://www.cnblogs.com/NicolasLen/p/5202830.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!