BC-DCBOR TypeScript Library - v1.0.0-alpha.20
    Preparing search index...

    Function bigintFromNegativeUntaggedCbor

    • Decode a BigInt from an untagged CBOR byte string for a negative bignum.

      Matches Rust's bigint_from_negative_untagged_cbor().

      This function is intended for use in tag summarizers where the tag has already been stripped. It expects a CBOR byte string representing n where the actual value is -1 - n (tag 3 content per RFC 8949).

      Enforces canonical encoding: no leading zero bytes (except single 0x00 for -1).

      Parameters

      • cbor: Cbor

        A CBOR value that should be a byte string

      Returns bigint

      Negative bigint

      CborError with type WrongType if not a byte string

      CborError with type NonCanonicalNumeric if encoding is non-canonical