namespace Jdb.Api.Services
{
public class BcryptPasswordHasher : IPasswordHasher
{
public string Hash(string password)
{
return BCrypt.Net.BCrypt.HashPassword(password);
}
public bool Verify(string password, string passwordHash)
{
if (string.IsNullOrWhiteSpace(passwordHash))
{
return false;
}
return BCrypt.Net.BCrypt.Verify(password, passwordHash);
}
}
}
|