Skip to content

Main content

Decoding: Protocol Buffers Wire Key Scalar Fields Tool

Decode one bounded Protocol Buffers wire key into legal field-number/wire-type fields, retaining legacy group types3/4 and rejecting field0 or wire6/7.

Loading tool…

Description

Split one bounded protobuf wire key into field and type.

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.

Split one bounded protobuf wire key into field and type.

When to use this tool

Use Decoding: Protocol Buffers Wire Key Scalar Fields when inspecting one supplied protobuf or variable-length encoding field.

How to use the tool and how it works

  1. Enter wireKey. 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.

Split one bounded protobuf wire key into field and type. Require whole unsigned32 key, field floor(key/8) in [1,536870911] and low-three-bit type <= 5.1

The protobuf wire key combines a field number with a wire type; fixed32 payloads use little-endian byte order. A local token check does not validate a message or schema.2

Input fieldMeaning and unitsAccepted input
wireKeyUnsigned 32-bit numeric key within the stated field-number and wire-type limits; compiler-reserved field numbers are accepted.Required. Safe integer.
Output fieldInterpretationReturned shape
resultReturned object; expand its named members below.Required. Object.
result.fieldNumberField NumberCalculated result member: number.
result.wireTypeWire TypeCalculated result member: number.
json
{
  "input": {
    "wireKey": 18
  },
  "output": {
    "result": {
      "fieldNumber": 2,
      "wireType": 2
    }
  }
}

Limitations and assumptions

  • Compiler-reserved field numbers 19000-19999 are accepted here, unlike the corresponding writer's restriction; no message is validated.
  • 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/protobuf-wire-key-scalar-fields — tool.io

  2. Protocol Buffers wire encoding — Protocol Buffers

Similar or alternative tools