Spaces:
Runtime error
Runtime error
File size: 371 Bytes
ad62c47 3871436 |
1 2 3 4 5 6 7 8 9 10 11 12 |
import bcrypt from 'bcryptjs';
export const hashPassword = async (password: string) => {
const salt = await bcrypt.genSalt(10);
const hashedPassword = await bcrypt.hash(password, salt);
return hashedPassword;
}
export const comparePassword = async (password: string, hashedPassword: string) => {
return await bcrypt.compare(password, hashedPassword);
}
|