Files
Cleanuparr/code/backend/Cleanuparr.Infrastructure/Features/Auth/PasswordService.cs
2026-02-15 13:15:06 +02:00

24 lines
507 B
C#

namespace Cleanuparr.Infrastructure.Features.Auth;
public sealed class PasswordService : IPasswordService
{
private const int WorkFactor = 12;
public string HashPassword(string password)
{
return BCrypt.Net.BCrypt.HashPassword(password, WorkFactor);
}
public bool VerifyPassword(string password, string hash)
{
try
{
return BCrypt.Net.BCrypt.Verify(password, hash);
}
catch
{
return false;
}
}
}