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

std/encoding/varint/mod.ts

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
import * as mod from "https://deno.land/std@0.177.0/encoding/varint/mod.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.