Description
Split any initial octet into CBOR fields and a reserved-value flag.
CBOR initial bytes combine major type and additional information. Some fields are reserved or context-dependent, and a break marker is meaningful only within a correctly tracked indefinite-length container.
Split any initial octet into CBOR fields and a reserved-value flag.
When to use this tool
Use Decoding: CBOR Initial Byte Fields when inspecting one explicit CBOR field or supplied break context.
How to use the tool and how it works
- Enter initialByte. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Split any initial octet into CBOR fields and a reserved-value flag. Require whole initialByte in [0,255]; majorType = floor(byte/32), additionalInformation = byte modulo 32; flag values 28-30.1
CBOR splits the initial octet into major type and additional information. Reserved or indefinite forms need type and container context beyond a bit-field split.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| initialByte | Initial Byte | Required. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Returned object; expand its named members below. | Required. Object. |
| result.majorType | Major Type | Calculated result member: number. |
| result.additionalInformation | Additional Information | Calculated result member: number. |
| result.reservedAdditionalInformation | Whether the low five bits are 28, 29 or 30; these are reported rather than rejected. | Calculated result member: boolean. |
{
"input": {
"initialByte": 161
},
"output": {
"result": {
"majorType": 5,
"additionalInformation": 1,
"reservedAdditionalInformation": false
}
}
} Limitations and assumptions
- Reserved fields are reported rather than rejected; no following payload or type-specific validity is checked.
- 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 CBOR parser to track nesting, following arguments and type-specific validity.
References
Similar or alternative tools
- CBOR Simple Value Initial Octet
Inspect a supported CBOR simple-value initial octet.
- CBOR Negative Integer Argument
Decode an exact CBOR negative-integer argument.