Files
drop/server/internal/security/simple.ts
2024-11-05 10:56:34 +11:00

11 lines
268 B
TypeScript

import bcrypt from 'bcryptjs';
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);
}