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

x/bencodex/src/utils.ts>compareUint8Arrays

An alternative take on implementing Bencodex in TypeScript/JavaScript
Latest
function compareUint8Arrays
import { compareUint8Arrays } from "https://deno.land/x/bencodex@0.2.2/src/utils.ts";

Compares two Uint8Arrays lexicographically.

Parameters

a: Uint8Array

An Uint8Array.

b: Uint8Array

Another Uint8Array.

Returns

number

A negative number if a is less than b, a positive number if a is greater than b, or zero if a and b are equal.