UNPKG

@iredium/butterfly

Version:
17 lines (16 loc) 481 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var bcrypt = require("bcrypt"); function compareHash(plainString, hashedString) { return new Promise(function (resolve, reject) { bcrypt.compare(plainString, hashedString, function (err, isMatch) { if (err) { reject(isMatch); } else { resolve(isMatch); } }); }); } exports.compareHash = compareHash;