Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/uint8array/index.ts>equals

A JavaScript extension package for building strong and modern applications.
Latest
function equals
import { equals } from "https://deno.land/x/ayonli_jsext@v0.9.72/uint8array/index.ts";

Checks if the two byte arrays are equal to each other.

Examples

Example 1

import { equals } from "@ayonli/jsext/bytes";

const arr1 = new Uint8Array([1, 2, 3]);
const arr2 = new Uint8Array([1, 2, 3]);
const arr3 = new Uint8Array([1, 2, 4]);

console.log(equals(arr1, arr2)); // true
console.log(equals(arr1, arr3)); // false

Parameters

arr1: Uint8Array
arr2: Uint8Array

Returns

boolean