Skip to content

Commit 1316c77

Browse files
thefourtheyeevanlucas
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 744ed94 commit 1316c77

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

1587-
### crypto.randomFillSync(buf[, offset][, size])
1587+
### crypto.randomFillSync(buffer[, offset][, size])
15881588
<!-- YAML
15891589
added: REPLACEME
15901590
-->
15911591

1592-
* `buf` {Buffer|Uint8Array} Must be supplied.
1592+
* `buffer` {Buffer|Uint8Array} Must be supplied.
15931593
* `offset` {number} Defaults to `0`.
1594-
* `size` {number} Defaults to `buf.length - offset`.
1594+
* `size` {number} Defaults to `buffer.length - offset`.
15951595

15961596
Synchronous version of [`crypto.randomFill()`][].
15971597

1598-
Returns `buf`
1598+
Returns `buffer`
15991599

16001600
```js
16011601
const buf = Buffer.alloc(10);
@@ -1609,14 +1609,14 @@ crypto.randomFillSync(buf, 5, 5);
16091609
console.log(buf.toString('hex'));
16101610
```
16111611

1612-
### crypto.randomFill(buf[, offset][, size], callback)
1612+
### crypto.randomFill(buffer[, offset][, size], callback)
16131613
<!-- YAML
16141614
added: REPLACEME
16151615
-->
16161616

1617-
* `buf` {Buffer|Uint8Array} Must be supplied.
1617+
* `buffer` {Buffer|Uint8Array} Must be supplied.
16181618
* `offset` {number} Defaults to `0`.
1619-
* `size` {number} Defaults to `buf.length - offset`.
1619+
* `size` {number} Defaults to `buffer.length - offset`.
16201620
* `callback` {Function} `function(err, buf) {}`.
16211621

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

0 commit comments

Comments
 (0)