Skip to content

quicVarintEncodedLength

quicVarintEncodedLength(firstByte): 1 | 2 | 4 | 8

Defined in: packages/format-varint/src/quic/quic-varint-byte-length.ts:38

How many bytes the QUIC variable-length integer starting with firstByte takes, read from its two most significant bits.

Lets a streaming parser check that a whole value is buffered before reading it, without a cursor or an exception.

number

The encoding’s first byte, 0 to 255.

1 | 2 | 4 | 8

1, 2, 4 or 8.