From 36c118bc924ebe7e54fd03780d6fab46734e9066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Thu, 23 Mar 2023 01:50:05 +0100 Subject: [PATCH] doc: remove use of DEFAULT_ENCODING in PBKDF2 docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no point in documenting this legacy behavior, which will emit a warning when used. PR-URL: https://github.com/nodejs/node/pull/47181 Reviewed-By: Ben Noordhuis Reviewed-By: Michaƫl Zasso Reviewed-By: Filip Skokan Reviewed-By: Luigi Pinca --- doc/api/crypto.md | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 29000bcbcca691..984cdbaa8da3c5 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -4430,28 +4430,6 @@ pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { }); ``` -The `crypto.DEFAULT_ENCODING` property can be used to change the way the -`derivedKey` is passed to the callback. This property, however, has been -deprecated and use should be avoided. - -```mjs -import crypto from 'node:crypto'; -crypto.DEFAULT_ENCODING = 'hex'; -crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => { - if (err) throw err; - console.log(derivedKey); // '3745e48...aa39b34' -}); -``` - -```cjs -const crypto = require('node:crypto'); -crypto.DEFAULT_ENCODING = 'hex'; -crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => { - if (err) throw err; - console.log(derivedKey); // '3745e48...aa39b34' -}); -``` - An array of supported digest functions can be retrieved using [`crypto.getHashes()`][]. @@ -4521,24 +4499,6 @@ const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); console.log(key.toString('hex')); // '3745e48...08d59ae' ``` -The `crypto.DEFAULT_ENCODING` property may be used to change the way the -`derivedKey` is returned. This property, however, is deprecated and use -should be avoided. - -```mjs -import crypto from 'node:crypto'; -crypto.DEFAULT_ENCODING = 'hex'; -const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512'); -console.log(key); // '3745e48...aa39b34' -``` - -```cjs -const crypto = require('node:crypto'); -crypto.DEFAULT_ENCODING = 'hex'; -const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512'); -console.log(key); // '3745e48...aa39b34' -``` - An array of supported digest functions can be retrieved using [`crypto.getHashes()`][].