using SIGCM2.Application.Abstractions.Security;
using BCryptNet = BCrypt.Net.BCrypt;

namespace SIGCM2.Infrastructure.Security;

public sealed class BcryptPasswordHasher : IPasswordHasher
{
    private const int WorkFactor = 12;

    public bool Verify(string plainPassword, string hash)
        => BCryptNet.Verify(plainPassword, hash);

    public string Hash(string plainPassword)
        => BCryptNet.HashPassword(plainPassword, WorkFactor);
}
