mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-09 20:12:10 +10:00
11 lines
266 B
TypeScript
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);
|
|
} |