From 396acf3bbbe00a192cb0ea0a9ccf91b1d8d2850b Mon Sep 17 00:00:00 2001 From: Fuwn <50817549+Fuwn@users.noreply.github.com> Date: Sat, 24 Jan 2026 13:09:50 +0000 Subject: Initial commit Created from https://vercel.com/new --- src/lib/password.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/lib/password.ts (limited to 'src/lib/password.ts') diff --git a/src/lib/password.ts b/src/lib/password.ts new file mode 100644 index 0000000..f5c450b --- /dev/null +++ b/src/lib/password.ts @@ -0,0 +1,11 @@ +import bcrypt from 'bcryptjs'; + +const SALT_ROUNDS = 10; + +export function hashPassword(password: string, rounds = SALT_ROUNDS) { + return bcrypt.hashSync(password, rounds); +} + +export function checkPassword(password: string, passwordHash: string) { + return bcrypt.compareSync(password, passwordHash); +} -- cgit v1.2.3