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

x/discord_rpc_deno/deps.ts>bytes.equals

port of @xhayper/discord-rpc to deno
Latest
function bytes.equals
import { bytes } from "https://deno.land/x/discord_rpc_deno@v1.1.4/deps.ts";
const { equals } = bytes;

Check whether byte slices are equal to each other.

Examples

Basic usage

import { equals } from "https://deno.land/std@0.224.0/bytes/equals.ts";

const a = new Uint8Array([1, 2, 3]);
const b = new Uint8Array([1, 2, 3]);
const c = new Uint8Array([4, 5, 6]);

equals(a, b); // true
equals(b, c); // false

Parameters

a: Uint8Array

First array to check equality.

b: Uint8Array

Second array to check equality.

Returns

boolean

true if the arrays are equal, false otherwise.