Files
sign/packages/lib/server-only/auth/hash.ts

15 lines
420 B
TypeScript
Raw Normal View History

import { compareSync as bcryptCompareSync, hashSync as bcryptHashSync } from 'bcrypt';
2023-06-09 18:21:18 +10:00
import { SALT_ROUNDS } from '../../constants/auth';
/**
* @deprecated Use the methods built into `bcrypt` instead
*/
export const hashSync = (password: string) => {
return bcryptHashSync(password, SALT_ROUNDS);
};
export const compareSync = (password: string, hash: string) => {
return bcryptCompareSync(password, hash);
};