feat: initial boilerplate
This commit is contained in:
11
api/libraries/crypto/password.ts
Normal file
11
api/libraries/crypto/password.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import * as bcrypt from "@felix/bcrypt";
|
||||
|
||||
export const password = { hash, verify };
|
||||
|
||||
async function hash(password: string): Promise<string> {
|
||||
return bcrypt.hash(password);
|
||||
}
|
||||
|
||||
async function verify(password: string, hash: string): Promise<boolean> {
|
||||
return bcrypt.verify(password, hash);
|
||||
}
|
||||
Reference in New Issue
Block a user