- Added @eslint/js dependency - Updated eslint.config.js for ESLint 9 compatibility - Added required globals (crypto, localStorage, React, etc.) - Fixed unused imports and variables - Disabled sort-imports temporarily - Formatted all files with Prettier
16 lines
352 B
TypeScript
16 lines
352 B
TypeScript
/**
|
|
* Password hashing utilities using bcryptjs.
|
|
*/
|
|
|
|
import bcrypt from 'bcryptjs';
|
|
|
|
const SALT_ROUNDS = 12;
|
|
|
|
export async function hashPassword(plain: string): Promise<string> {
|
|
return bcrypt.hash(plain, SALT_ROUNDS);
|
|
}
|
|
|
|
export async function verifyPassword(plain: string, hash: string): Promise<boolean> {
|
|
return bcrypt.compare(plain, hash);
|
|
}
|