This commit is contained in:
lik
2026-05-25 12:46:14 +08:00
parent 01d54cc580
commit 17014446ba
24 changed files with 5932 additions and 0 deletions

13
utils/passwdCrypto.js Normal file
View File

@@ -0,0 +1,13 @@
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 }