import { compare , hash } from 'bcryptjs' ; import IHashProvider from '../models/IHashProvider' ; class BCryptHashProvider implements IHashProvider { public async generateHash ( payload ) { return hash ( payload , 8 ) ; } public async compareHash ( payload , hashed ) { return compare ( payload , hashed ) ; } } export default BCryptHashProvider ;