import * as bcrypt from 'bcryptjs'; export class Encrypter { public async hash(text: string): Promise { const rounds = 12; const salt = await bcrypt.genSalt(rounds); const result = await bcrypt.hash(text, salt); return result; } public async compare(text: string, hash: string): Promise { return await bcrypt.compare(text, hash); } }