Skip to content

bigVlqDecoder

const bigVlqDecoder: Decoder<bigint>

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

A base-128 VLQ as a streaming Decoder producing bigint — the unbounded counterpart of vlqDecoder.

Same framing behaviour: a VLQ delimits itself, so a truncated sequence is incomplete with no needAtLeast floor better than “one more byte”, and an overlong encoding is fatal. Unlike vlqDecoder it has no range to exceed, so the only fatal outcome is a malformed sequence.

Stateless, so one instance serves every caller and reset is unnecessary.