md5加密算法c:c#md5加密

  1. 首先创建MD5哈希算法

  ((HashAlgorithm).Security.Cryptogrophy.CryptoConfig.CreateFromName("MD5")).ComputeHash(.Text.UTF8.GetBytes(input))

  2.计算哈希值

  使用思路方法:ComputeHash( value);

  3.转化成串.

1protected virtual HashMD5( input)
2    {
3       result = ((HashAlgorithm).Security.Cryptography.CryptoConfig.CreateFromName("MD5")).ComputeHash(.Text.Encoding.UTF8.GetBytes(input));
4      StringBuilder output = StringBuilder(16);      
5                  
6      for ( i = 0; i < result.Length; i)
7      {              
8        // convert from hexa-decimal to character
9        output.Append((result[i]).( "x2", .Globalization.CultureInfo.InvariantCulture));        
10      }
11       output.;
12    }
13


Tags:  md5在线加密 md5加密算法 md5加密 md5加密算法c

延伸阅读

最新评论

发表评论