decodeVlq
decodeVlq(
bytes):number
Defined in: packages/format-varint/src/vlq/decode-vlq.ts:19
Decodes a buffer holding exactly one base-128 VLQ.
The one-shot counterpart of readVlq, for a caller that already knows the extent of the value. Decoding a run of values from one buffer is readVlq’s job — it does not re-scan and does not allocate per value.
Parameters
Section titled “Parameters”Uint8Array
A buffer holding one complete encoding and nothing else.
Returns
Section titled “Returns”number
The decoded value, from 0 to Number.MAX_SAFE_INTEGER.
Throws
Section titled “Throws”When the encoding is truncated.
Throws
Section titled “Throws”When the encoding is overlong, out of range, or followed by unread bytes.