(password: string, rounds = SALT_ROUNDS)
| 3 | const SALT_ROUNDS = 10; |
| 4 | |
| 5 | export function hashPassword(password: string, rounds = SALT_ROUNDS) { |
| 6 | return bcrypt.hashSync(password, rounds); |
| 7 | } |
| 8 | |
| 9 | export function checkPassword(password: string, passwordHash: string) { |
| 10 | return bcrypt.compareSync(password, passwordHash); |