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

    Function cborToBigint

    • Convert CBOR to a bigint (any sign).

      Matches Rust's TryFrom<CBOR> for BigInt.

      Accepts:

      • Major type 0 (unsigned integer)
      • Major type 1 (negative integer)
      • Tag 2 (positive bignum) with canonical byte string
      • Tag 3 (negative bignum) with canonical byte string

      Rejects:

      • Floating-point values -> WrongType
      • Non-canonical bignum encodings -> NonCanonicalNumeric

      Parameters

      • cbor: Cbor

        The CBOR value to convert

      Returns bigint

      A bigint value

      CborError