mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
doc: mark the callback argument of crypto.generatePrime as mandatory
The current documentation lists the `callback` argument of `crypto.generatePrime` as optional (it's surrounded by square brackets), but this is incorrect - calling the function without a callback will result in an `ERR_INVALID_ARG_TYPE` error: For the record, the correct way to generate a prime synchronously, without a callback, is to use the `generatePrimeSync` API. This patch fixes the documentation and marks the callback argument as mandatory. The `options` (second) argument, is indeed optional, and is marked as such. Fixes: https://github.com/nodejs/node/issues/58298 PR-URL: https://github.com/nodejs/node/pull/58299 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
This commit is contained in:
1 parent
39d9a61239
commit
670f31060b
1 file changed
+1
-1
+1
-1
@@ -3884,7 +3884,7 @@ console.log(key.export().toString('hex')); // e89..........41e
|
||||
The size of a generated HMAC key should not exceed the block size of the
|
||||
underlying hash function. See [`crypto.createHmac()`][] for more information.
|
||||
|
||||
### `crypto.generatePrime(size[, options[, callback]])`
|
||||
### `crypto.generatePrime(size[, options], callback)`
|
||||
|
||||
<!-- YAML
|
||||
added: v15.8.0
|
||||
|
||||
Reference in new issue
Block a user