templates2.Base.Next/lib/password.ts
w4c-templates 219be916cb
Some checks are pending
CI / quality (push) Waiting to run
chore(template): publish Base.Next
2026-10-11 23:23:30 +03:00

11 lines
331 B
TypeScript

import bcrypt from 'bcryptjs';
/** Pure password helpers (no server-only import) so they are unit-testable. */
export function hashPassword(plain: string): Promise<string> {
return bcrypt.hash(plain, 10);
}
export function verifyPassword(plain: string, hash: string): Promise<boolean> {
return bcrypt.compare(plain, hash);
}