@blockchaincommons/dcbor - v1.0.0-beta.1
    Preparing search index...
    • Encode a value to deterministic CBOR bytes. Accepts anything cbor() accepts; equal values always produce identical bytes (dCBOR determinism).

      Parameters

      Returns Uint8Array<ArrayBuffer>

      encodeCbor({ a: 1 });            // Uint8Array [0xa1, 0x61, 0x61, 0x01]
      bytesToHex(encodeCbor("Hello")); // "6548656c6c6f"

      Whatever cbor(value) throws for unsupported inputs (OutOfRange, Custom).

      The decoder's canonicality check re-encodes every decoded value through this function, so it is wire-critical.