((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
最新评论