decodeCBORNoLeftoverBytes()

Decodes the CBOR-encoded data and returns the decoded value as CBORValue. See decodeCBOR() for details on errors and behavior.

In addition to errors thrown by decodeCBOR(), it will also throw CBORLeftoverBytesError if there are any leftover bytes.

Definition

function decodeCBORNoLeftoverBytes(data: Uint8Array, maxDepth: number): CBORValue;

Parameters

  • data
  • maxDepth: How much nesting is allowed (exclusive) where the first iteration is depth 0.