UnicodeEncoding HashAlgorithm CryptoConfig BitConverter
2006-10-09 17:34
471 查看
using System.Text;
using System.Security.Cryptography;
public static string Encrypt(string password)
{
Byte[] clearBytes=new UnicodeEncoding().GetBytes(password);
Byte[] hashedBytes=((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
return BitConverter.ToString(hashedBytes);
}
using System.Security.Cryptography;
public static string Encrypt(string password)
{
Byte[] clearBytes=new UnicodeEncoding().GetBytes(password);
Byte[] hashedBytes=((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
return BitConverter.ToString(hashedBytes);
}
相关文章推荐
- 二、nodejs图片处理(gm) api: https://www.npmjs.com/package/gm 及 MD5加密:http://nodejs.cn/doc/node/crypto.html#crypto_crypto_createhash_algorithm
- mysql 连接url中useUnicode=true&characterEncoding=UTF-8 的作用
- 关于unicode,mbcs,utf8,charset,encoding等相关概念的说明
- useUnicode=true&characterEncoding=UTF-8的作用
- [转]关于unicode,mbcs,utf8,charset,encoding等相关概念的说明
- Defense hash algorithm collision 防御hash算法冲突导致拒绝服务器
- 海量数据处理:分治-Hash映射+Bit-map+Bloome Filter
- Mysql JDBC Url参数说明useUnicode=true&characterEncoding=UTF-8
- url=jdbc:mysql//localhost:3306/spring_dao?useUnicode=true&characterEncoding=UTF-8
- scrapy相关 通过设置 FEED_EXPORT_ENCODING 解决 unicode 中文写入json文件出现`\uXXXX`
- Mysql JDBC Url参数说明useUnicode=true&characterEncoding=UTF-8
- 关于unicode,mbcs,utf8,charset,encoding等相关概念的说明....Zzz
- hrbustoj 1681 回文串 [BIT]【字符串hash】
- 关于unicode,mbcs,utf8,charset,encoding等相关概念的说明
- hashpasswordforstoringinconfigfile过时
- UnicodeEncoding 类
- 【Jabberd2源码剖析系列 util (不包括nad, xhash, xdata, jid, config, stanza)】
- FormsAuthentication.HashPasswordForStoringInConfigFile 方法 之研究
- 关于友盟分析工具couldn’t be opened using text encoding Unicode (UTF-8)的处理
- 关于unicode,mbcs,utf8,charset,encoding等相关概念的说明