| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent da16ca7 commit 1e97ccd
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4423,28 +4423,6 @@ pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { | |||
| 4423 | 4423 | }); | |
| 4424 | 4424 | ``` | |
| 4425 | 4425 | ||
| 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 | - | ||
| 4448 | 4426 | An array of supported digest functions can be retrieved using | |
| 4449 | 4427 | [`crypto.getHashes()`][]. | |
| 4450 | 4428 | ||
@@ -4514,24 +4492,6 @@ const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); | |||
| 4514 | 4492 | console.log(key.toString('hex')); // '3745e48...08d59ae' | |
| 4515 | 4493 | ``` | |
| 4516 | 4494 | ||
| 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 | - | ||
| 4535 | 4495 | An array of supported digest functions can be retrieved using | |
| 4536 | 4496 | [`crypto.getHashes()`][]. | |
| 4537 | 4497 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments