Skip to content

Main content

CBOR Simple Value Initial Octet Tool

Classify CBOR major-type-seven simple-value initial octets; 0xf8 requires the next byte.

Loading tool…

Description

Inspect a supported CBOR simple-value initial octet.

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.

Inspect a supported CBOR simple-value initial octet.

When to use this tool

Use CBOR Simple Value Initial Octet when inspecting one explicit CBOR field or supplied break context.

How to use the tool and how it works

  1. Enter octet. 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 simpleValue, followingByte. Inspect followingByte before interpreting the associated values.

Inspect a supported CBOR simple-value initial octet. Require whole octet in [224,248]; return simpleValue = octet-224 except 248 returns -1 and followingByte = true.1

Input fieldMeaning and unitsAccepted input
octetOne numeric octet, from 0 through 255.Required. Safe integer; minimum 224; maximum 248.
Output fieldInterpretationReturned shape
simpleValueImmediate simple value, or -1 when followingByte is true.Required. Safe integer.
followingByteTrue for initial octet 248; the next byte is not read or validated.Required. Boolean.
json
{
  "input": {
    "octet": 245
  },
  "output": {
    "simpleValue": 21,
    "followingByte": false
  }
}

Limitations and assumptions

  • The following byte for 248 is not read; reserved following values and full item validity are separate checks.
  • 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

  1. Calculation and input contract: decode/cbor-simple-value-initial-octet — tool.io

Similar or alternative tools