import * as crypto from 'crypto'; import * as argon2 from 'argon2'; export function generateSecureToken(length = 32): string { return crypto.randomBytes(length).toString('hex'); } export function hashPassword(password: string): Promise { return argon2.hash(password); } export function verifyPassword( passwordHash: string, clearTextPassword: string, ): Promise { return argon2.verify(passwordHash, clearTextPassword); }