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-11 09:01:59 +02:00

13 lines
328 B
TypeScript

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