napi_status napi_create_bigint_words(napi_env env,
int sign_bit,
size_t word_count,
const uint64_t* words,
napi_value* result);
[in] env
: The environment that the API is invoked under.[in] sign_bit
: Determines if the resultingBigInt
will be positive or negative.[in] word_count
: The length of thewords
array.[in] words
: An array ofuint64_t
little-endian 64-bit words.[out] result
: Anapi_value
representing a JavaScriptBigInt
.
Returns napi_ok
if the API succeeded.
This API converts an array of unsigned 64-bit words into a single BigInt
value.
The resulting BigInt
is calculated as: (–1)sign_bit
(words[0]
× (264)0 + words[1]
× (264)1 + …)