Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/justaos_utils/packages/common-utils/deps.ts>bcrypt.compareSync

Common utility functions used across projects
Go to Latest
function bcrypt.compareSync
import { bcrypt } from "https://deno.land/x/justaos_utils@v1.9.0/packages/common-utils/deps.ts";
const { compareSync } = bcrypt;

Check if a plaintext password matches a hash This function is blocking and computationally expensive but requires no additonal flags. Using the async variant is highly recommended.

Parameters

plaintext: string

The plaintext password to check

hash: string

The hash to compare to

Returns

boolean

Whether the password matches the hash