@iredium/butterfly
Version:
Express API Framework
18 lines (17 loc) • 511 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.compareHash = void 0;
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;