Skip to content

Commit

Permalink
doc: deprecate crypto.getRandomValues alias
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jan 30, 2022
1 parent 253f934 commit 7777f22
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doc/api/crypto.md
Expand Up @@ -4107,13 +4107,14 @@ console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...]

<!-- YAML
added: v17.4.0
deprecated: REPLACEME
-->

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

A convenient alias for [`crypto.webcrypto.getRandomValues()`][].

### `crypto.hkdf(digest, ikm, salt, info, keylen, callback)`

<!-- YAML
Expand Down
16 changes: 16 additions & 0 deletions doc/api/deprecations.md
Expand Up @@ -3056,6 +3056,21 @@ This method was deprecated because it is not compatible with

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

### DEP0159: `require('node:crypto').getRandomValues()`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/41596
description: Documentation-only deprecation.
-->

Type: Documentation-only

This method was deprecated because it is is relying on a non-standard behavior.

Use [`crypto.webcrypto.getRandomValues()`][] instead.

[Legacy URL API]: url.md#legacy-url-api
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
Expand Down Expand Up @@ -3094,6 +3109,7 @@ Use [`buffer.subarray`][] which does the same thing instead.
[`crypto.pbkdf2()`]: crypto.md#cryptopbkdf2password-salt-iterations-keylen-digest-callback
[`crypto.randomBytes()`]: crypto.md#cryptorandombytessize-callback
[`crypto.scrypt()`]: crypto.md#cryptoscryptpassword-salt-keylen-options-callback
[`crypto.webcrypto.getRandomValues()`]: webcrypto.md#cryptogetrandomvaluestypedarray
[`decipher.final()`]: crypto.md#decipherfinaloutputencoding
[`decipher.setAuthTag()`]: crypto.md#deciphersetauthtagbuffer-encoding
[`dns.lookup()`]: dns.md#dnslookuphostname-options-callback
Expand Down

0 comments on commit 7777f22

Please sign in to comment.