19 lines
515 B
C#
19 lines
515 B
C#
using System.Security.Cryptography;
|
|
using System.Text;
|
|
|
|
namespace DHSoftware.Utils
|
|
{
|
|
// 密码加密辅助类
|
|
public static class HashHelper
|
|
{
|
|
public static string MD5Encrypt(string input)
|
|
{
|
|
using (var md5 = MD5.Create())
|
|
{
|
|
byte[] inputBytes = Encoding.UTF8.GetBytes(input);
|
|
byte[] hashBytes = md5.ComputeHash(inputBytes);
|
|
return BitConverter.ToString(hashBytes).Replace("-", "");
|
|
}
|
|
}
|
|
}
|
|
} |