good forst commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import * as bcrypt from 'bcryptjs';
|
||||
|
||||
export async function hashPassword(plain: string, rounds: number = 10): Promise<string> {
|
||||
return bcrypt.hash(plain, rounds);
|
||||
}
|
||||
|
||||
export async function verifyPassword(plain: string, hash: string): Promise<boolean> {
|
||||
return bcrypt.compare(plain, hash);
|
||||
}
|
||||
Reference in New Issue
Block a user