Skip to content

Commit 43a2bc0

Browse files
thefourtheyeMylesBorins
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 <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 6f62f83 commit 43a2bc0

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
@@ -1588,18 +1588,18 @@ This should normally never take longer than a few milliseconds. The only time
15881588
when generating the random bytes may conceivably block for a longer period of
15891589
time is right after boot, when the whole system is still low on entropy.
15901590

1591-
### crypto.randomFillSync(buf[, offset][, size])
1591+
### crypto.randomFillSync(buffer[, offset][, size])
15921592
<!-- YAML
15931593
added: REPLACEME
15941594
-->
15951595

1596-
* `buf` {Buffer|Uint8Array} Must be supplied.
1596+
* `buffer` {Buffer|Uint8Array} Must be supplied.
15971597
* `offset` {number} Defaults to `0`.
1598-
* `size` {number} Defaults to `buf.length - offset`.
1598+
* `size` {number} Defaults to `buffer.length - offset`.
15991599

16001600
Synchronous version of [`crypto.randomFill()`][].
16011601

1602-
Returns `buf`
1602+
Returns `buffer`
16031603

16041604
```js
16051605
const buf = Buffer.alloc(10);
@@ -1613,14 +1613,14 @@ crypto.randomFillSync(buf, 5, 5);
16131613
console.log(buf.toString('hex'));
16141614
```
16151615

1616-
### crypto.randomFill(buf[, offset][, size], callback)
1616+
### crypto.randomFill(buffer[, offset][, size], callback)
16171617
<!-- YAML
16181618
added: REPLACEME
16191619
-->
16201620

1621-
* `buf` {Buffer|Uint8Array} Must be supplied.
1621+
* `buffer` {Buffer|Uint8Array} Must be supplied.
16221622
* `offset` {number} Defaults to `0`.
1623-
* `size` {number} Defaults to `buf.length - offset`.
1623+
* `size` {number} Defaults to `buffer.length - offset`.
16241624
* `callback` {Function} `function(err, buf) {}`.
16251625

16261626
This function is similar to [`crypto.randomBytes()`][] but requires the first
@@ -2067,7 +2067,7 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
20672067
[`crypto.getHashes()`]: #crypto_crypto_gethashes
20682068
[`crypto.pbkdf2()`]: #crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback
20692069
[`crypto.randomBytes()`]: #crypto_crypto_randombytes_size_callback
2070-
[`crypto.randomFill()`]: #crypto_crypto_randombytesbuffer_buf_size_offset_cb
2070+
[`crypto.randomFill()`]: #crypto_crypto_randomfill_buffer_offset_size_callback
20712071
[`decipher.final()`]: #crypto_decipher_final_output_encoding
20722072
[`decipher.update()`]: #crypto_decipher_update_data_input_encoding_output_encoding
20732073
[`diffieHellman.setPublicKey()`]: #crypto_diffiehellman_setpublickey_public_key_encoding

0 commit comments

Comments
 (0)