import * as bcrypt from "bcrypt" ; import logger from "./logger" ; const generateHash = async ( password , saltRounds ) : Promise < string > => new Promise ( ( resolve , reject ) => { bcrypt . hash ( password , saltRounds , ( err , hash ) => { if ( ! err ) { resolve ( hash ) ; } reject ( err ) ; } ) ; } ) ; const verifyHash = async ( password , hash ) : Promise < boolean > => new Promise ( ( resolve , reject ) => { bcrypt . compare ( password , hash , ( err , result ) => { logger . debug ( err ) ; logger . debug ( result ) ; if ( err ) { reject ( err ) ; } resolve ( result ) ; } ) ; } ) ; export { generateHash , verifyHash } ;