App_Code/EncryptHelper.cs
(完整代码) 766Busing System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
namespace CommonLib
{
public class EncryptHelper
{
/// <summary>
/// 对字符串进行MD5或SHA1加密操作
/// </summary>
/// <param name="cleanString">明文字符串</param>
/// <returns>加密后的字符串</returns>
public static string Encrypt(string cleanString, string strPasswordFormat)
{
Byte[] clearBytes = new UnicodeEncoding().GetBytes(cleanString);
Byte[] hashedBytes = ((HashAlgorithm)CryptoConfig.CreateFromName(strPasswordFormat)).ComputeHash(clearBytes);
return BitConverter.ToString(hashedBytes);
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。