napi_create_bigint_words


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:调用该 API 时所处的环境。
  • [in] sign_bit:确定生成的 BigInt 是正数还是负数。
  • [in] word_countwords 数组的长度。
  • [in] words:一个 uint64_t 小端 64 位字的数组。
  • [out] result:表示 JavaScript BigIntnapi_value

如果 API 成功,则返回 napi_ok

【Returns napi_ok if the API succeeded.】

此 API 将一个无符号 64 位字数组转换为单个 BigInt 值。

【This API converts an array of unsigned 64-bit words into a single BigInt value.】

得到的 BigInt 计算如下:(–1)sign_bit (words[0] × (264)0 + words[1] × (264)1 + …)