mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
13 lines
336 B
TypeScript
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);
|
|
}
|
|
}
|