crypto.checkPrime(candidate[, options[, callback]])
candidate
<ArrayBuffer> | <SharedArrayBuffer> | <TypedArray> | <Buffer> | <DataView> | <bigint> 编码为任意长度的大端字节序序列的可能素数。options
<Object>checks
<number> 要执行的 Miller-Rabin 概率素性迭代次数。 当值为0
(零)时,使用多次检查对随机输入产生最多 2-64 的误报率。 选择多个检查时必须小心。 有关更多详细信息,请参阅BN_is_prime_ex
函数nchecks
选项的 OpenSSL 文档。 默认值:0
callback
<Function>
检查 candidate
的素性。
candidate
<ArrayBuffer> | <SharedArrayBuffer> | <TypedArray> | <Buffer> | <DataView> | <bigint> A possible prime encoded as a sequence of big endian octets of arbitrary length.options
<Object>checks
<number> The number of Miller-Rabin probabilistic primality iterations to perform. When the value is0
(zero), a number of checks is used that yields a false positive rate of at most 2-64 for random input. Care must be used when selecting a number of checks. Refer to the OpenSSL documentation for theBN_is_prime_ex
functionnchecks
options for more details. Default:0
callback
<Function>
Checks the primality of the candidate
.