Files
opengifame/lib/crypt.ts
Fergal Moran d131663c36 Sort terms
2022-10-15 17:14:34 +01:00

15 lines
353 B
TypeScript

import bcrypt from 'bcrypt';
export const hashPassword = async (password: string): Promise<string> => {
const hashed = await bcrypt.hash(password, 0);
return hashed;
};
export const confirmPassword = async (
password: string,
hashed: string
): Promise<boolean> => {
const result = await bcrypt.compare(password, hashed);
return result;
};