Files
tower/apps/api/src/modules/auth/password.util.ts
T
2026-06-09 02:02:40 +05:30

10 lines
293 B
TypeScript

import * as bcrypt from 'bcryptjs';
export async function hashPassword(plain: string, rounds: number = 10): Promise<string> {
return bcrypt.hash(plain, rounds);
}
export async function verifyPassword(plain: string, hash: string): Promise<boolean> {
return bcrypt.compare(plain, hash);
}