UNPKG

@ita-company/ita-package

Version:

<p align="center"> <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a> </p>

18 lines (13 loc) 397 B
import { Injectable } from '@nestjs/common'; import * as bcrypt from 'bcrypt'; @Injectable() export class PasswordHelper { constructor() { } hashPassword(password: string): string { return bcrypt.hash(password, 10); } comparePassword(password: string, passwordHash: string): boolean { return bcrypt.compare(password, passwordHash); } }