Skip to content

Commit f04f09d

Browse files
mureiniktargos
authored andcommitted
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: #58298 PR-URL: #58299 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
1 parent 3b9b010 commit f04f09d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/crypto.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3900,7 +3900,7 @@ console.log(key.export().toString('hex')); // e89..........41e
39003900
The size of a generated HMAC key should not exceed the block size of the
39013901
underlying hash function. See [`crypto.createHmac()`][] for more information.
39023902

3903-
### `crypto.generatePrime(size[, options[, callback]])`
3903+
### `crypto.generatePrime(size[, options], callback)`
39043904

39053905
<!-- YAML
39063906
added: v15.8.0

0 commit comments

Comments
 (0)