/// <summary>
/// 用户加密函数
/// </summary>
public static String Encrypt(string password)
{
Byte[] clearBytes = new UnicodeEncoding().GetBytes(password);//生成unicode字符串
Byte[] hashedBytes = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
return BitConverter.ToString(hashedBytes);//BitConverter将基础数据类型与字节数组相互转换。
}
一个加密算法
最新推荐文章于 2022-04-14 20:52:48 发布