@@ -4430,28 +4430,6 @@ pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => {
4430
4430
});
4431
4431
```
4432
4432
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
-
4455
4433
An array of supported digest functions can be retrieved using
4456
4434
[ ` crypto.getHashes() ` ] [ ] .
4457
4435
@@ -4521,24 +4499,6 @@ const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');
4521
4499
console .log (key .toString (' hex' )); // '3745e48...08d59ae'
4522
4500
```
4523
4501
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
-
4542
4502
An array of supported digest functions can be retrieved using
4543
4503
[ ` crypto.getHashes() ` ] [ ] .
4544
4504
0 commit comments