Skip to content

readBigVlq

readBigVlq(reader): bigint

Defined in: packages/format-varint/src/vlq/read-big-vlq.ts:22

Reads one base-128 VLQ from reader as a bigint, advancing it past the bytes consumed — the unbounded counterpart of readVlq.

Has no range limit to report: X.660 caps no OID arc, and a bigint holds whatever the bytes say. Prefer readVlq wherever the value is known to fit a number; bigint arithmetic is markedly slower and allocates.

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

ByteReader

Cursor positioned at the first byte of the encoding.

bigint

The decoded value, zero or greater.

When the bytes run out while a continuation bit is still set.

When the encoding is overlong.