@blockchaincommons/components - v1.0.0-beta.4
    Preparing search index...

    Class CborJson

    A CBOR-tagged container for UTF-8 CborJson text.

    Wraps UTF-8 CborJson text as a CBOR byte string with tag 262. This allows CborJson data to be embedded within CBOR structures while maintaining type information through the tag.

    Implements

    • ToCbor
    Index
    • get byteLength(): number

      Number of bytes.

      Returns number

    • get bytes(): Uint8Array

      The bytes (a view; do not mutate).

      Returns Uint8Array

    • Create a new CborJson instance from byte data.

      Parameters

      • data: Uint8Array

      Returns CborJson

    • Create a new CborJson instance from a string.

      Parameters

      • s: string

      Returns CborJson

    • Create a new CborJson instance from a hexadecimal string.

      Parameters

      • hex: string

      Returns CborJson

    • Return true if the CborJson data is empty.

      Returns boolean

    • Return the data as a UTF-8 string slice.

      Returns string

      Error if the data is not valid UTF-8.

    • Return the data as a hexadecimal string.

      Returns string

    • Get string representation.

      Returns string

    • The CBOR tags this type decodes from; the first one is used to encode.

      Returns Tag[]

    • Returns the untagged CBOR encoding (as a byte string).

      Returns Cbor

    • The tagged CBOR form.

      Returns Cbor

    • As a UR, typed by the first tag's name.

      Returns UR

    • Decode tagged or untagged CBOR.

      Parameters

      • cborValue: Cbor

      Returns CborJson