@geniucode/common-utils
Version:
Common utils
10 lines • 364 B
JavaScript
import bcrypt from 'bcryptjs';
export async function encryptPassword(password) {
const salt = await bcrypt.genSalt(10);
const hash = await bcrypt.hash(password, salt);
return hash;
}
export async function comparePasswords(password, hashedPassword) {
return bcrypt.compare(password, hashedPassword);
}
//# sourceMappingURL=password-encryption.js.map