Skip to content

Commit 95ab006

Browse files
thefourtheyejasnell
authored andcommitted
doc: improve randomfill and fix broken link
This patch replaces the word `buf` with `buffer` and fixes the broken link to `randomfill`. PR-URL: #12541 Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 5096651 commit 95ab006

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

doc/api/crypto.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1713,18 +1713,18 @@ This should normally never take longer than a few milliseconds. The only time
17131713
when generating the random bytes may conceivably block for a longer period of
17141714
time is right after boot, when the whole system is still low on entropy.
17151715

1716-
### crypto.randomFillSync(buf[, offset][, size])
1716+
### crypto.randomFillSync(buffer[, offset][, size])
17171717
<!-- YAML
17181718
added: REPLACEME
17191719
-->
17201720

1721-
* `buf` {Buffer|Uint8Array} Must be supplied.
1721+
* `buffer` {Buffer|Uint8Array} Must be supplied.
17221722
* `offset` {number} Defaults to `0`.
1723-
* `size` {number} Defaults to `buf.length - offset`.
1723+
* `size` {number} Defaults to `buffer.length - offset`.
17241724

17251725
Synchronous version of [`crypto.randomFill()`][].
17261726

1727-
Returns `buf`
1727+
Returns `buffer`
17281728

17291729
```js
17301730
const buf = Buffer.alloc(10);
@@ -1738,14 +1738,14 @@ crypto.randomFillSync(buf, 5, 5);
17381738
console.log(buf.toString('hex'));
17391739
```
17401740

1741-
### crypto.randomFill(buf[, offset][, size], callback)
1741+
### crypto.randomFill(buffer[, offset][, size], callback)
17421742
<!-- YAML
17431743
added: REPLACEME
17441744
-->
17451745

1746-
* `buf` {Buffer|Uint8Array} Must be supplied.
1746+
* `buffer` {Buffer|Uint8Array} Must be supplied.
17471747
* `offset` {number} Defaults to `0`.
1748-
* `size` {number} Defaults to `buf.length - offset`.
1748+
* `size` {number} Defaults to `buffer.length - offset`.
17491749
* `callback` {Function} `function(err, buf) {}`.
17501750

17511751
This function is similar to [`crypto.randomBytes()`][] but requires the first
@@ -2213,7 +2213,7 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
22132213
[`crypto.getHashes()`]: #crypto_crypto_gethashes
22142214
[`crypto.pbkdf2()`]: #crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback
22152215
[`crypto.randomBytes()`]: #crypto_crypto_randombytes_size_callback
2216-
[`crypto.randomFill()`]: #crypto_crypto_randombytesbuffer_buf_size_offset_cb
2216+
[`crypto.randomFill()`]: #crypto_crypto_randomfill_buffer_offset_size_callback
22172217
[`decipher.final()`]: #crypto_decipher_final_output_encoding
22182218
[`decipher.update()`]: #crypto_decipher_update_data_input_encoding_output_encoding
22192219
[`diffieHellman.setPublicKey()`]: #crypto_diffiehellman_setpublickey_public_key_encoding

0 commit comments

Comments
 (0)