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

std/encoding/varint.ts>MaxUInt64

The Deno Standard Library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
variable MaxUInt64
import { MaxUInt64 } from "https://deno.land/std@0.222.0/encoding/varint.ts";

Functions for encoding typed integers in array buffers.

import { encode, decode } from "https://deno.land/std@0.222.0/encoding/varint.ts";

const buf = new Uint8Array(10);
const [encoded, bytesWritten] = encode(42n, buf);
// [ Uint8Array(1) [ 42 ], 1 ];

decode(encoded); // [ 42n, 1 ];

type

18446744073709551615