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

    Module @blockchaincommons/dcbor

    @blockchaincommons/dcbor - Deterministic CBOR (dCBOR) for TypeScript.

    • Construct: cbor(input) - the single polymorphic constructor. taggedValue(tag, content) is the only explicit tagged-value constructor. Custom types implement ToCbor { toCbor(): Cbor }.
    • Encode: encodeCbor(value): Uint8Array<ArrayBuffer>.
    • Decode: decodeCbor(bytes) throws CborError; tryDecode(bytes) is the non-throwing twin returning Result<Cbor>. The try prefix means "returns Result, never throws" - everywhere.
    • Read: free accessors with fixed prefix semantics: isX(c) = type-narrowing guard; asX(c) = T | undefined; expectX(c) = T or throw. Containers mirror the JS Map/Set vocabulary.
    • Format/traverse: import { diagnostic, hexAnnotated } from "@blockchaincommons/dcbor/diagnostic"; import { walk } from "@blockchaincommons/dcbor/walk"; opt-in debug output via @blockchaincommons/dcbor/debug.
    ByteString
    CborDate
    CborError
    CborMap
    CborSet
    TagsStore
    CborUnsignedType
    CborNegativeType
    CborByteStringType
    CborTextType
    CborArrayType
    CborMapType
    CborTaggedType
    CborSimpleType
    CborMethods
    ToCbor
    CborTagged
    CborCodec
    CborErrorDetails
    CborErrorDetailsByCode
    MapEntry
    CBORSortable
    Tag
    ReadonlyTagsStore
    MajorType
    CborNumber
    CborInput
    Cbor
    CborErrorCode
    CborErrorTyped
    Result
    CborNative
    Simple
    TagValue
    SummarizerResult
    CborSummarizer
    TagsStoreOpt
    MajorType
    Tag
    TAG_DATE_TIME_STRING
    TAG_EPOCH_DATE_TIME
    TAG_EPOCH_DATE
    TAG_POSITIVE_BIGNUM
    TAG_NEGATIVE_BIGNUM
    TAG_NAME_POSITIVE_BIGNUM
    TAG_NAME_NEGATIVE_BIGNUM
    TAG_DECIMAL_FRACTION
    TAG_BIGFLOAT
    TAG_BASE64URL
    TAG_BASE64
    TAG_BASE16
    TAG_ENCODED_CBOR
    TAG_URI
    TAG_BASE64URL_TEXT
    TAG_BASE64_TEXT
    TAG_REGEXP
    TAG_MIME_MESSAGE
    TAG_UUID
    TAG_STRING_REF_NAMESPACE
    TAG_BINARY_UUID
    TAG_SET
    TAG_SELF_DESCRIBE_CBOR
    TAG_DATE
    TAG_NAME_DATE
    biguintToCbor
    bigintToCbor
    biguintFromUntaggedCbor
    bigintFromNegativeUntaggedCbor
    cborToBiguint
    cborToBigint
    isCborNumber
    isCbor
    cborEquals
    cbor
    encodeCbor
    taggedValue
    decodeWith
    validateTag
    extractTaggedContent
    asUnsigned
    asNegative
    asInteger
    asBytes
    asText
    asArray
    asMap
    asBoolean
    asFloat
    asNumber
    arrayItem
    arrayLength
    arrayIsEmpty
    mapValue
    mapHas
    mapKeys
    mapValues
    mapSize
    mapIsEmpty
    tagValue
    tagContent
    hasTag
    getTaggedContent
    asTaggedValue
    expectUnsigned
    expectNegative
    expectInteger
    expectBytes
    expectText
    expectArray
    expectMap
    expectBoolean
    expectFloat
    expectNumber
    expectTaggedContent
    isUnsigned
    isNegative
    isInteger
    isBytes
    isText
    isArray
    isMap
    isTagged
    isSimple
    isBoolean
    isNull
    isFloat
    isNumber
    decodeCbor
    tryDecode
    Ok
    Err
    extractCbor
    hasFractionalPart
    bytesToHex
    hexToBytes
    simpleName
    isCborNaN
    sortArrayByCborEncoding
    arraySortable
    setSortable
    getGlobalTagsStore
    withTags
    registerStandardTags
    tagsForValues
    encodeVarInt
    decodeVarIntData
    decodeVarInt