@iredium/butterfly
Version:
Express API Framework
17 lines (16 loc) • 481 B
JavaScript
;
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;