Skip to content

Commit 7777f22

Browse files
committed
doc: deprecate crypto.getRandomValues alias
Refs: nodejs#41760
1 parent 253f934 commit 7777f22

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

‎doc/api/crypto.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4107,13 +4107,14 @@ console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...]
41074107

41084108
<!-- YAML
41094109
added: v17.4.0
4110+
deprecated: REPLACEME
41104111
-->
41114112

4113+
> Stability: 0 - Deprecated. Use [`crypto.webcrypto.getRandomValues()`][] instead.
4114+
41124115
* `typedArray` {Buffer|TypedArray|DataView|ArrayBuffer}
41134116
* Returns: {Buffer|TypedArray|DataView|ArrayBuffer} Returns `typedArray`.
41144117

4115-
A convenient alias for [`crypto.webcrypto.getRandomValues()`][].
4116-
41174118
### `crypto.hkdf(digest, ikm, salt, info, keylen, callback)`
41184119

41194120
<!-- YAML

‎doc/api/deprecations.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3056,6 +3056,21 @@ This method was deprecated because it is not compatible with
30563056

30573057
Use [`buffer.subarray`][] which does the same thing instead.
30583058

3059+
### DEP0159: `require('node:crypto').getRandomValues()`
3060+
3061+
<!-- YAML
3062+
changes:
3063+
- version: REPLACEME
3064+
pr-url: https://github.com/nodejs/node/pull/41596
3065+
description: Documentation-only deprecation.
3066+
-->
3067+
3068+
Type: Documentation-only
3069+
3070+
This method was deprecated because it is is relying on a non-standard behavior.
3071+
3072+
Use [`crypto.webcrypto.getRandomValues()`][] instead.
3073+
30593074
[Legacy URL API]: url.md#legacy-url-api
30603075
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
30613076
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
@@ -3094,6 +3109,7 @@ Use [`buffer.subarray`][] which does the same thing instead.
30943109
[`crypto.pbkdf2()`]: crypto.md#cryptopbkdf2password-salt-iterations-keylen-digest-callback
30953110
[`crypto.randomBytes()`]: crypto.md#cryptorandombytessize-callback
30963111
[`crypto.scrypt()`]: crypto.md#cryptoscryptpassword-salt-keylen-options-callback
3112+
[`crypto.webcrypto.getRandomValues()`]: webcrypto.md#cryptogetrandomvaluestypedarray
30973113
[`decipher.final()`]: crypto.md#decipherfinaloutputencoding
30983114
[`decipher.setAuthTag()`]: crypto.md#deciphersetauthtagbuffer-encoding
30993115
[`dns.lookup()`]: dns.md#dnslookuphostname-options-callback

0 commit comments

Comments
 (0)