好贷网好贷款

C# MD5加密

发布时间:2016-12-4 22:32:17 编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"C# MD5加密",主要涉及到C# MD5加密方面的内容,对于C# MD5加密感兴趣的同学可以参考一下。

class NonceGenerator     {         public static NonceGenerator instance = new NonceGenerator();         public static NonceGenerator getInstance()         {             return instance;         }         public static string md5(string password)         {             MD5 md5 = new MD5CryptoServiceProvider();             byte[] res = md5.ComputeHash(Encoding.Default.GetBytes(password), 0, password.Length);             StringBuilder builder = new StringBuilder();             foreach (byte b in res)             {                 builder.Append(Convert.ToString(b, 16));             }             return builder.ToString();         }         public static string md5(string spid, string created, string sppassword)         {             String password = spid + created + sppassword;             MD5 md5 = new MD5CryptoServiceProvider();             byte[] res = md5.ComputeHash(Encoding.Default.GetBytes(password), 0, password.Length);             StringBuilder builder = new StringBuilder();             foreach (byte b in res)             {                 builder.Append(Convert.ToString(b, 16));             }             return builder.ToString();         }     }

上一篇:UIView简单动画
下一篇:Fedora 19下安装无限网卡驱动(Intel Corporation Wireless 7260 (rev 73))

相关文章

关键词: C# MD5加密

相关评论