1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/backend/model/PasswordHelper.ts
2017-07-12 18:31:19 +02:00

13 lines
336 B
TypeScript

import * as bcryptjs from "bcryptjs";
export class PasswordHelper {
public static cryptPassword(password) {
const salt = bcryptjs.genSaltSync(10);
return bcryptjs.hashSync(password, salt);
}
public static comparePassword(password, encryptedPassword) {
return bcryptjs.compareSync(password, encryptedPassword);
}
}