amati/src/modules/auth/utils/hashPassword.ts
2024-02-14 09:56:37 +07:00

15 lines
372 B
TypeScript

import bcrypt from "bcrypt";
import authConfig from "../authConfig";
/**
* Hashes a plain text password using bcrypt.
*
* @param password - The plain text password to hash.
* @returns The hashed password.
*/
export async function hashPassword(password: string): Promise<string> {
return bcrypt.hash(password, authConfig.saltRounds);
}
export default hashPassword;