Skip to main content
Module

std/encoding/varint.ts>decodeU64

Deno standard library
Go to Latest
function decodeU64
Deprecated
Deprecated

(will be removed after 0.181.0) Use decode64() from std/encoding/varint.ts instead.

Decodes the given Uint8Array into a BigInt with LEB128.

import { decodeU64 } from "https://deno.land/std@0.180.0/encoding/varint/mod.ts";
const bytes = Uint8Array.from([221, 199, 1]);
const decodedValue = decodeU64(bytes);

// Do something with the decoded value
console.log(decodedValue === 25565n);
import { decodeU64 } from "https://deno.land/std@0.180.0/encoding/varint.ts";

Parameters

val: Uint8Array

Returns

bigint