2023-12-01 05:52:16 +05:30
|
|
|
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);
|
|
|
|
|
};
|
2023-12-01 05:52:16 +05:30
|
|
|
|
|
|
|
|
export const compareSync = (password: string, hash: string) => {
|
|
|
|
|
return bcryptCompareSync(password, hash);
|
|
|
|
|
};
|