@@ -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-
44554433An 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');
45214499console .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-
45424502An array of supported digest functions can be retrieved using
45434503[ ` crypto.getHashes() ` ] [ ] .
45444504
0 commit comments