Check whether byte slices are equal to each other.
First array to check equality.
Second array to check equality.
true if the arrays are equal, false otherwise.
true
false
import { equals } from "@std/bytes/equals";import { assertEquals } from "@std/assert";const a = new Uint8Array([1, 2, 3]);const b = new Uint8Array([1, 2, 3]);const c = new Uint8Array([4, 5, 6]);assertEquals(equals(a, b), true);assertEquals(equals(a, c), false); Copy
import { equals } from "@std/bytes/equals";import { assertEquals } from "@std/assert";const a = new Uint8Array([1, 2, 3]);const b = new Uint8Array([1, 2, 3]);const c = new Uint8Array([4, 5, 6]);assertEquals(equals(a, b), true);assertEquals(equals(a, c), false);
Check whether byte slices are equal to each other.