Skip to content

encodeBigVlq

encodeBigVlq(value): Uint8Array<ArrayBuffer>

Defined in: packages/format-varint/src/vlq/encode-big-vlq.ts:24

Encodes a non-negative bigint as a base-128 VLQ — the unbounded counterpart of encodeVlq.

X.660 puts no ceiling on an OID arc and X.690 §8.19.2 none on a subidentifier, so the encoding has a range number cannot cover. Reach for this only when a value may exceed Number.MAX_SAFE_INTEGER: every ASN.1 tag number and all but pathological arcs fit a number, and bigint arithmetic is markedly slower.

Time complexity: O(log₁₂₈ value).

bigint

A non-negative bigint.

Uint8Array<ArrayBuffer>

A fresh buffer holding the encoding, never empty.

When value is negative.