import { Injectable } from '@nestjs/common' ; import * as bcrypt from 'bcryptjs' ; /**
 * Crypto util
 */ @ Injectable ( ) export class CryptoUtil { param password async encryptPassword ( password ) { return bcrypt . hash ( password , bcrypt . genSaltSync ( ) ) ; } param password param passwordHash async checkPassword ( password , passwordHash ) { return bcrypt . compare ( password , passwordHash ) ; } }