Encode a BigInt instance into a Buffer, ensuring it adheres to specific constraints.

  • Parameters

    • bi: bigint

      BigInt instance to encode.

    • maxBytes: number

      Maximum byte length allowed for the encoding. If undefined, no byte size limit is imposed.

    • context: string

      Contextual information for error messages.

    Returns Uint8Array

    Encoded data.