import { hash, verify, type Options } from "@node-rs/argon2";

const passwordHashOptions = {
  algorithm: 2,
  memoryCost: 19_456,
  timeCost: 3,
  parallelism: 1,
} satisfies Options;

export function hashPassword(password: string) {
  return hash(password, passwordHashOptions);
}

export function verifyPassword(passwordHash: string, password: string) {
  return verify(passwordHash, password, passwordHashOptions);
}
