equals
import { equals } from "jsr:@ende/bytes";function
function equals(a: Uint8Array, b: Uint8Array): booleanCheck whether byte slices are equal to each other.
a: Uint8ArrayFirst array to check equality.
b: Uint8ArraySecond array to check equality.
Returns
true if the arrays are equal, false otherwise.
Example: Basic usage
import { equals } from "@ende/bytes/equals";
import { assertEquals } from "@ende/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);