@arsendoman/book-publisher-store
Version:
A Nest.js package for book publishing and storing
14 lines (11 loc) • 328 B
text/typescript
import { Injectable } from '@nestjs/common';
import { hash, compare } from 'bcryptjs';
()
export class HashHelper {
hashPassword(password: string): Promise<string> {
return hash(password, 10);
}
comparePassword(password: string, hash: string): Promise<boolean> {
return compare(password, hash);
}
}