Revert "提交"

This reverts commit b96d895809.
This commit is contained in:
2026-02-12 21:59:08 +08:00
parent b96d895809
commit d429560511
339 changed files with 46657 additions and 46655 deletions
+21 -21
View File
@@ -1,21 +1,21 @@
using System.Security.Cryptography;
using System.Text;
namespace IM_API.Tools
{
public static class PasswordHasher
{
public static string HashPassword(string password)
{
using var sha256 = SHA256.Create();
var hashedBytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(password));
return Convert.ToBase64String(hashedBytes);
}
public static bool VerifyPassword(string password, string hashedPassword)
{
var hashedInput = HashPassword(password);
return hashedInput == hashedPassword;
}
}
}
using System.Security.Cryptography;
using System.Text;
namespace IM_API.Tools
{
public static class PasswordHasher
{
public static string HashPassword(string password)
{
using var sha256 = SHA256.Create();
var hashedBytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(password));
return Convert.ToBase64String(hashedBytes);
}
public static bool VerifyPassword(string password, string hashedPassword)
{
var hashedInput = HashPassword(password);
return hashedInput == hashedPassword;
}
}
}