Skip to content

Main content

Decoding: Leb128 Byte Continuation Bit Tool

Split one LEB128 byte into continuation flag and seven-bit payload without interpreting a whole signed/unsigned integer stream.

Loading tool…

Description

Extract a LEB128 group's continuation flag and payload.

Variable-length integer groups and protobuf keys separate continuation bits, payload, field number and wire type. Extracting one field does not validate termination, canonical integer representation or message structure.

Extract a LEB128 group's continuation flag and payload.

When to use this tool

Use Decoding: Leb128 Byte Continuation Bit when inspecting one supplied protobuf or variable-length encoding field.

How to use the tool and how it works

  1. Enter byte. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read result. Expand result to inspect the returned fields.

Extract a LEB128 group's continuation flag and payload. Require whole byte in [0,255]; continuation = byte >= 128 and payload = byte modulo 128.1

Input fieldMeaning and unitsAccepted input
byteOne numeric octet, from 0 through 255.Required. Safe integer.
Output fieldInterpretationReturned shape
resultReturned object; expand its named members below.Required. Object.
result.continuationContinuationCalculated result member: boolean.
result.payloadPayloadCalculated result member: number.
json
{
  "input": {
    "byte": 129
  },
  "output": {
    "result": {
      "continuation": true,
      "payload": 1
    }
  }
}

Limitations and assumptions

  • This does not assemble groups, check termination or sign-extend a signed LEB128 value.
  • Outputs are nested inside result. 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 schema-aware serializer/parser for full messages, signed-value rules and interoperability.

References

  1. Calculation and input contract: decode/leb128-byte-continuation-bit — tool.io

Similar or alternative tools