UNPKG

@tomei/sso

Version:
15 lines (11 loc) 431 B
import * as argon2 from 'argon2'; import { IPasswordHashService } from './interfaces/password-hash-service.interface'; export class PasswordHashService implements IPasswordHashService { constructor() {} async hashPassword(password: string): Promise<string> { return await argon2.hash(password); } async verify(password: string, hash: string): Promise<boolean> { return await argon2.verify(hash, password); } }