Skip to content

Commit 1e97ccd

Browse files
tniessendanielleadams
authored andcommitted
doc: remove use of DEFAULT_ENCODING in PBKDF2 docs
There is no point in documenting this legacy behavior, which will emit a warning when used. PR-URL: #47181 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent da16ca7 commit 1e97ccd

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

doc/api/crypto.md

-40
Original file line numberDiff line numberDiff line change
@@ -4423,28 +4423,6 @@ pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => {
44234423
});
44244424
```
44254425

4426-
The `crypto.DEFAULT_ENCODING` property can be used to change the way the
4427-
`derivedKey` is passed to the callback. This property, however, has been
4428-
deprecated and use should be avoided.
4429-
4430-
```mjs
4431-
import crypto from 'node:crypto';
4432-
crypto.DEFAULT_ENCODING = 'hex';
4433-
crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => {
4434-
if (err) throw err;
4435-
console.log(derivedKey); // '3745e48...aa39b34'
4436-
});
4437-
```
4438-
4439-
```cjs
4440-
const crypto = require('node:crypto');
4441-
crypto.DEFAULT_ENCODING = 'hex';
4442-
crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => {
4443-
if (err) throw err;
4444-
console.log(derivedKey); // '3745e48...aa39b34'
4445-
});
4446-
```
4447-
44484426
An array of supported digest functions can be retrieved using
44494427
[`crypto.getHashes()`][].
44504428

@@ -4514,24 +4492,6 @@ const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');
45144492
console.log(key.toString('hex')); // '3745e48...08d59ae'
45154493
```
45164494

4517-
The `crypto.DEFAULT_ENCODING` property may be used to change the way the
4518-
`derivedKey` is returned. This property, however, is deprecated and use
4519-
should be avoided.
4520-
4521-
```mjs
4522-
import crypto from 'node:crypto';
4523-
crypto.DEFAULT_ENCODING = 'hex';
4524-
const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512');
4525-
console.log(key); // '3745e48...aa39b34'
4526-
```
4527-
4528-
```cjs
4529-
const crypto = require('node:crypto');
4530-
crypto.DEFAULT_ENCODING = 'hex';
4531-
const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512');
4532-
console.log(key); // '3745e48...aa39b34'
4533-
```
4534-
45354495
An array of supported digest functions can be retrieved using
45364496
[`crypto.getHashes()`][].
45374497

0 commit comments

Comments
 (0)