• Converts a bigint to a buffer and fills with zeros if a valid size (i.e. number of bytes) is specified. If the size is not defined, it gets the size from the given bigint. If the specified size is smaller than the size of the bigint (i.e. minSize), an error is thrown. It uses big-endian byte order.

    Parameters

    • value: bigint

      The bigint to convert.

    • Optional size: number

      The number of bytes of the buffer to return.

    Returns Buffer

    The buffer representation of the bigint.