@blockchaincommons/dcbor - v1.0.0-beta.1
    Preparing search index...

    Interface CborMethods

    The instance methods every Cbor value carries.

    Exactly three cheap conveniences; everything else is a free function.

    interface CborMethods {
        toData(): Uint8Array<ArrayBuffer>;
        toHex(): string;
        toString(): string;
    }
    Index
    • Encode to deterministic CBOR bytes (same as encodeCbor(this)).

      Returns Uint8Array<ArrayBuffer>

    • Encode and render as lowercase hex.

      Returns string

    • Cheap debug string: Cbor(0x…) with the encoded hex.

      For the flat diagnostic form use diagnostic(c, { flat: true }) from @blockchaincommons/dcbor/diagnostic, or installDebugHooks() from @blockchaincommons/dcbor/debug for diag-flavored console output.

      Returns string