Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/willow_utils/src/encoding/encoding.ts>encodeCompactWidth

TypeScript typings and utilities for the Willow protocol.
Go to Latest
function encodeCompactWidth
import { encodeCompactWidth } from "https://deno.land/x/willow_utils@0.8.0/src/encoding/encoding.ts";

Encodes an integer using the smallest number of bytes possible.

https://willowprotocol.org/specs/encodings/index.html#compact_width

Parameters

num: number | bigint

Returns

Uint8Array