Description
Read the top two bits of firstOctet as an exponent.
QUIC uses compact fields and truncated packet numbers. Their interpretation depends on the unprotected header bits and connection state; decoding a number does not authenticate a packet.
Read the top two bits of firstOctet as an exponent.
When to use this tool
Use QUIC Varint Leading Length Bits when you need one QUIC field interpretation from already available bytes or state.
How to use the tool and how it works
- Enter firstOctet. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read lengthBytes, payloadBits. Use the output convention below.
Read the top two bits of firstOctet as an exponent. Return 2 raised to that exponent as lengthBytes and 8 × lengthBytes - 2 as payloadBits.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| firstOctet | First Octet | Required. Safe integer; minimum 0; maximum 255. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| lengthBytes | Length Bytes | Required. Safe integer. |
| payloadBits | Payload Bits | Required. Safe integer. |
{
"input": {
"firstOctet": 192
},
"output": {
"lengthBytes": 8,
"payloadBits": 62
}
} Limitations and assumptions
- Only the length prefix is decoded; the remaining bytes and value are not read.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use a complete QUIC implementation to remove header protection, track packet state, and authenticate payloads.
References
Similar or alternative tools
- QUIC Packet Number Truncated Window
Combine the expected packet number's high bits with the truncated low bits.
- QUIC Short Header Keyphase Bit
Return bit two as keyPhase and bit five as a Boolean spin value.