mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
11 lines
302 B
TypeScript
11 lines
302 B
TypeScript
import bcrypt from 'bcryptjs';
|
|
|
|
const SALT_ROUNDS = 10;
|
|
|
|
export function hashPassword(password: string, rounds = SALT_ROUNDS) {
|
|
return bcrypt.hashSync(password, rounds);
|
|
}
|
|
|
|
export function checkPassword(password: string, passwordHash: string) {
|
|
return bcrypt.compareSync(password, passwordHash);
|
|
}
|