Files
drop/server/internal/security/simple.ts
2024-09-28 19:12:11 +10:00

11 lines
266 B
TypeScript

import bcrypt from 'bcrypt';
const rounds = 10;
export async function createHash(password: string) {
return bcrypt.hashSync(password, rounds);
}
export async function checkHash(password: string, hash: string) {
return bcrypt.compareSync(password, hash);
}