推送
This commit is contained in:
23
DHSoftware/Utils/HashHelper.cs
Normal file
23
DHSoftware/Utils/HashHelper.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
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("-", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user