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

x/willow_utils/src/encoding/encoding.ts

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

Functions

Returns the number of octets needed to store a number, along the lines of 8-bit, 16-bit, 32-bit, or 64-bit unsigned integers.

Decode a variable width integer. Uses the bytelength of the passed encoding to determine the compact width.

Decodes an UintMax unsigned integer,

Encodes an integer using the smallest number of bytes possible.

Encodes a number as a UintMax, with Max being the maximum number of octets needed to represent the unsigned integer

Returns the maximum number of octets needed to store an unsigned integer.