Skip to content

Commit 36c118b

Browse files
tniessenRafaelGSS
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 <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 5419535 commit 36c118b

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
@@ -4430,28 +4430,6 @@ pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => {
44304430
});
44314431
```
44324432

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

@@ -4521,24 +4499,6 @@ const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');
45214499
console.log(key.toString('hex')); // '3745e48...08d59ae'
45224500
```
45234501

4524-
The `crypto.DEFAULT_ENCODING` property may be used to change the way the
4525-
`derivedKey` is returned. This property, however, is deprecated and use
4526-
should be avoided.
4527-
4528-
```mjs
4529-
import crypto from '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-
4535-
```cjs
4536-
const crypto = require('node:crypto');
4537-
crypto.DEFAULT_ENCODING = 'hex';
4538-
const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512');
4539-
console.log(key); // '3745e48...aa39b34'
4540-
```
4541-
45424502
An array of supported digest functions can be retrieved using
45434503
[`crypto.getHashes()`][].
45444504

0 commit comments

Comments
 (0)