mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
doc: improve randomfill and fix broken link
This patch replaces the word `buf` with `buffer` and fixes the broken link to `randomfill`. PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
6f62f83468
commit
43a2bc040f
1 file changed
+8
-8
+8
-8
@@ -1588,18 +1588,18 @@ This should normally never take longer than a few milliseconds. The only time
|
||||
when generating the random bytes may conceivably block for a longer period of
|
||||
time is right after boot, when the whole system is still low on entropy.
|
||||
|
||||
### crypto.randomFillSync(buf[, offset][, size])
|
||||
### crypto.randomFillSync(buffer[, offset][, size])
|
||||
<!-- YAML
|
||||
added: REPLACEME
|
||||
-->
|
||||
|
||||
* `buf` {Buffer|Uint8Array} Must be supplied.
|
||||
* `buffer` {Buffer|Uint8Array} Must be supplied.
|
||||
* `offset` {number} Defaults to `0`.
|
||||
* `size` {number} Defaults to `buf.length - offset`.
|
||||
* `size` {number} Defaults to `buffer.length - offset`.
|
||||
|
||||
Synchronous version of [`crypto.randomFill()`][].
|
||||
|
||||
Returns `buf`
|
||||
Returns `buffer`
|
||||
|
||||
```js
|
||||
const buf = Buffer.alloc(10);
|
||||
@@ -1613,14 +1613,14 @@ crypto.randomFillSync(buf, 5, 5);
|
||||
console.log(buf.toString('hex'));
|
||||
```
|
||||
|
||||
### crypto.randomFill(buf[, offset][, size], callback)
|
||||
### crypto.randomFill(buffer[, offset][, size], callback)
|
||||
<!-- YAML
|
||||
added: REPLACEME
|
||||
-->
|
||||
|
||||
* `buf` {Buffer|Uint8Array} Must be supplied.
|
||||
* `buffer` {Buffer|Uint8Array} Must be supplied.
|
||||
* `offset` {number} Defaults to `0`.
|
||||
* `size` {number} Defaults to `buf.length - offset`.
|
||||
* `size` {number} Defaults to `buffer.length - offset`.
|
||||
* `callback` {Function} `function(err, buf) {}`.
|
||||
|
||||
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.
|
||||
[`crypto.getHashes()`]: #crypto_crypto_gethashes
|
||||
[`crypto.pbkdf2()`]: #crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback
|
||||
[`crypto.randomBytes()`]: #crypto_crypto_randombytes_size_callback
|
||||
[`crypto.randomFill()`]: #crypto_crypto_randombytesbuffer_buf_size_offset_cb
|
||||
[`crypto.randomFill()`]: #crypto_crypto_randomfill_buffer_offset_size_callback
|
||||
[`decipher.final()`]: #crypto_decipher_final_output_encoding
|
||||
[`decipher.update()`]: #crypto_decipher_update_data_input_encoding_output_encoding
|
||||
[`diffieHellman.setPublicKey()`]: #crypto_diffiehellman_setpublickey_public_key_encoding
|
||||
|
||||
Reference in new issue
Block a user