mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-02 12:47:41 +02:00
11 lines
295 B
TypeScript
11 lines
295 B
TypeScript
const bcrypt = require('bcryptjs');
|
|
|
|
export function hashPassword(password: string): string {
|
|
const salt = bcrypt.genSaltSync(10);
|
|
return bcrypt.hashSync(password, salt);
|
|
}
|
|
|
|
export function checkPassword(password: string, hash: string): boolean {
|
|
return bcrypt.compareSync(password, hash);
|
|
}
|