Files
api_health/utils/passwdCrypto.js
2026-05-25 12:46:14 +08:00

13 lines
228 B
JavaScript

import bcrypt from 'bcrypt';
const SALT_ROUNDS = 10;
function hash(text) {
return bcrypt.hash(text, SALT_ROUNDS);
}
function compare(text, hash) {
return bcrypt.compare(text, hash);
}
export default { hash, compare }