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

x/mandarinets/security-core/utils/securityUtils.ts>SecurityUtils.compare

Mandarine.TS is a typescript, decorator-driven framework that allows you to create server-side applications. Mandarine.TS provides a range of built-in solutions such as Dependency Injection, Components, ORM and more. Under its umbrella, Mandarine.TS has 4 modules: Core, Data, Security and MVC, these modules will offer you the requirements to build a Mandarine-powered application.
Latest
method SecurityUtils.compare
import { SecurityUtils } from "https://deno.land/x/mandarinets@v2.3.2/security-core/utils/securityUtils.ts";

Compare two strings, Uint8Arrays, ArrayBuffers, or arrays of numbers in a way that avoids timing based attacks on the comparisons on the values.

The function will return true if the values match, or false, if they do not match.

Parameters

a:
| string
| number[]
| ArrayBuffer
| Uint8Array
b:
| string
| number[]
| ArrayBuffer
| Uint8Array

Returns

boolean