From 7777f22a709f002da835370af99df01d8651b370 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 31 Jan 2022 00:34:29 +0100 Subject: [PATCH 1/3] doc: deprecate `crypto.getRandomValues` alias Refs: https://github.com/nodejs/node/pull/41760 --- doc/api/crypto.md | 5 +++-- doc/api/deprecations.md | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 4b1a54326295c7..3f7387c2044108 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -4107,13 +4107,14 @@ console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] +> 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)` + +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 @@ -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 From aaa325d4c28ee6f9253b8e3561ec29ffb4f67390 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 31 Jan 2022 00:43:13 +0100 Subject: [PATCH 2/3] fixup! doc: deprecate `crypto.getRandomValues` alias --- doc/api/crypto.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 3f7387c2044108..9b60e609b8b6a6 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -4110,7 +4110,8 @@ added: v17.4.0 deprecated: REPLACEME --> -> Stability: 0 - Deprecated. Use [`crypto.webcrypto.getRandomValues()`][] instead. +> Stability: 0 - Deprecated. Use [`crypto.webcrypto.getRandomValues()`][] +> instead. * `typedArray` {Buffer|TypedArray|DataView|ArrayBuffer} * Returns: {Buffer|TypedArray|DataView|ArrayBuffer} Returns `typedArray`. From 21c43c5db9bc93cdccb35f6e086e5dc2dbb0e22e Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 31 Jan 2022 11:19:20 +0100 Subject: [PATCH 3/3] fixup! doc: deprecate `crypto.getRandomValues` alias --- doc/api/deprecations.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 06679fbdf8791d..b6527527d3a358 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -3061,13 +3061,14 @@ Use [`buffer.subarray`][] which does the same thing instead. Type: Documentation-only -This method was deprecated because it is is relying on a non-standard behavior. +This method is deprecated because of compatibility issues with the rest of the +JavaScript ecosystem. Use [`crypto.webcrypto.getRandomValues()`][] instead.