码迷,mamicode.com
首页 > 编程语言 > 详细

SHA1算法

时间:2016-11-22 11:55:14      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:put   ice   hash   ret   .com   encoding   turn   byte   odi   

 public string SHA1_Hash(string str_sha1_in)
        {
            SHA1 sha1 = new SHA1CryptoServiceProvider();
            byte[] bytes_sha1_in = UTF8Encoding.Default.GetBytes(str_sha1_in);
            byte[] bytes_sha1_out = sha1.ComputeHash(bytes_sha1_in);
            string str_sha1_out = BitConverter.ToString(bytes_sha1_out);
            str_sha1_out = str_sha1_out.Replace("-", "").ToLower();
            return str_sha1_out;
        }

SHA1算法

标签:put   ice   hash   ret   .com   encoding   turn   byte   odi   

原文地址:http://www.cnblogs.com/sk2016/p/6088177.html

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