Skip to content

Main content

CBOR Negative Integer Argument Tool

Decode a CBOR major-type-one unsigned argument as an exact decimal negative integer.

Loading tool…

Description

Decode an exact CBOR negative-integer argument.

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.

Decode an exact CBOR negative-integer argument.

When to use this tool

Use CBOR Negative Integer Argument when inspecting one explicit CBOR field or supplied break context.

How to use the tool and how it works

  1. Enter argument. 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 integer. Use the output convention below.

Decode an exact CBOR negative-integer argument. Parse decimal argument in [0,18446744073709551615] and return integer = -1-argument as exact decimal text.1

Input fieldMeaning and unitsAccepted input
argumentArgumentRequired. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above.
Output fieldInterpretationReturned shape
integerIntegerRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "argument": "24"
  },
  "output": {
    "integer": "-25"
  }
}

Limitations and assumptions

  • This is an argument transformation, not byte decoding or tagged bignum handling.
  • 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.

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-negative-integer-argument — tool.io

Similar or alternative tools