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

x/bencodex/src/types.ts>compareKeys

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

Compares two keys in the specified order in the Bencodex specification.

Parameters

a: Key

A key to compare.

b: Key

Another key to compare.

Returns

number

A negative number if a is former than b, zero if a is equal to b, or a positive number if a is latter than b.