Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: deprecate crypto.getRandomValues alias #41779

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions doc/api/crypto.md
Expand Up @@ -4107,13 +4107,15 @@ 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
aduh95 marked this conversation as resolved.
Show resolved Hide resolved
description: Documentation-only deprecation.
-->

Type: Documentation-only

This method was deprecated because it is is relying on a non-standard behavior.
aduh95 marked this conversation as resolved.
Show resolved Hide resolved

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