Function binToBigIntUintBE

  • Decode a big-endian Uint8Array of any length into a BigInt. If starting from a hex value, consider using the BigInt constructor instead:

    BigInt(`0x${hex}`)
    

    The bytes parameter can be set to constrain the expected length (default: bin.length). This method throws if bin.length is not equal to bytes.

    For the reverse, see bigIntToBinUintBE.

    Parameters

    • bin: Uint8Array

      the Uint8Array to decode

    • bytes: number = bin.length

      the number of bytes to read (default: bin.length)

    Returns bigint

Generated using TypeDoc