Module

std/encoding/varint.ts

Deno standard library
Go to Latest
import * as mod from "https://deno.land/std@0.152.0/encoding/varint.ts";

Functions for encoding typed integers in array buffers.

Functions

Decodes the given Uint8Array into a number with LEB128.

Decodes the given Uint8Array into a BigInt with LEB128.

Encodes the given number into Uint8Array with LEB128. The number needs to be in the range of 0 and 0xffffffff.

Encodes the given BigInt into Uint8Array with LEB128. The number needs to be in the range of 0 and 0xffffffffffffffff.