@exodus/bytes
    Preparing search index...
    • Convert a BigInt to a Uint8Array or Buffer

      The output bytes are in big-endian format.

      Throws if the BigInt is negative or cannot fit into the specified length.

      Parameters

      • bigint: bigint

        The BigInt to convert (must be non-negative)

      • options: { format?: "uint8"; length: number }

        Conversion options

      Returns Uint8Array

      The converted bytes in big-endian format

    • Convert a BigInt to a Uint8Array or Buffer

      The output bytes are in big-endian format.

      Throws if the BigInt is negative or cannot fit into the specified length.

      Parameters

      • bigint: bigint

        The BigInt to convert (must be non-negative)

      • options: { format: "buffer"; length: number }

        Conversion options

      Returns Buffer

      The converted bytes in big-endian format

    • Convert a BigInt to a Uint8Array or Buffer

      The output bytes are in big-endian format.

      Throws if the BigInt is negative or cannot fit into the specified length.

      Parameters

      • bigint: bigint

        The BigInt to convert (must be non-negative)

      • options: FromBigIntOptions

        Conversion options

      Returns Uint8Array<ArrayBuffer> | Buffer<ArrayBufferLike>

      The converted bytes in big-endian format