This commit is contained in:
lik
2026-05-25 12:34:16 +08:00
parent c614b19b78
commit 1e7aa55533
986 changed files with 23880 additions and 0 deletions

13
api/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 }