import bcrypt from 'bcrypt';

const SALT_ROUNDS = 10;

export default class Authenticator {
  static async hashPassword(password: string): Promise<string> {
    return await bcrypt.hash(password, SALT_ROUNDS);
  }

  static async verifyPassword(password: string, hashedPassword: string): Promise<boolean> {
    return await bcrypt.compare(password, hashedPassword);
  }

  private constructor() {
    throw new Error('Authenticator is a static class and cannot be instantiated');
  }
}
