mirror of
https://github.com/fergalmoran/opengifame.git
synced 2025-12-22 09:38:44 +00:00
15 lines
353 B
TypeScript
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;
|
|
};
|