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

x/polkadot/util/u8a/cmp.ts>u8aCmp

Package publishing for deno.land/x/polkadot
Go to Latest
function u8aCmp
import { u8aCmp } from "https://deno.land/x/polkadot@0.2.19/util/u8a/cmp.ts";

Examples

import { u8aCmp } from 'https://deno.land/x/polkadot@0.2.19/util/mod.ts';

u8aCmp(new Uint8Array([0x67, 0x65]), new Uint8Array([0x68, 0x65])); // -1
u8aCmp(new Uint8Array([0x68, 0x65]), new Uint8Array([0x68, 0x65])); // 0
u8aCmp(new Uint8Array([0x69, 0x65]), new Uint8Array([0x68, 0x65])); // +1

Parameters

a: HexString | Uint8Array | string
b: HexString | Uint8Array | string

Returns

number