import { Injectable } from '@nestjs/common' ; import { compare , hash } from 'bcrypt' ; @ Injectable ( ) export class PasswordService { see https private saltRounds = 10 ; param password getHash ( password ) { return hash ( password , this . saltRounds ) ; } param password param passwordHash compareHash ( password , passwordHash ) { return compare ( password , passwordHash ) ; } }