import { compare, hash } from "bcryptjs"; export class CodemationBetterAuthBcryptPasswordCodec { private static readonly bcryptRounds = 12; async hashPlaintext(plaintextPassword: string): Promise { return await hash(plaintextPassword, CodemationBetterAuthBcryptPasswordCodec.bcryptRounds); } async verifyAgainstHash(args: Readonly<{ hash: string; password: string }>): Promise { return await compare(args.password, args.hash); } }