Browse Source

doc: reduce keylen in pbkdf2 examples

PR-URL: https://github.com/nodejs/node/pull/16203
Refs: https://github.com/nodejs/node/issues/3415
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
v9.x-staging
Lukas 7 years ago
committed by Tobias Nießen
parent
commit
b5c74d85fc
  1. 8
      doc/api/crypto.md

8
doc/api/crypto.md

@ -1617,9 +1617,9 @@ Example:
```js
const crypto = require('crypto');
crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => {
crypto.pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => {
if (err) throw err;
console.log(derivedKey.toString('hex')); // '3745e48...aa39b34'
console.log(derivedKey.toString('hex')); // '3745e48...08d59ae'
});
```
@ -1669,8 +1669,8 @@ Example:
```js
const crypto = require('crypto');
const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512');
console.log(key.toString('hex')); // '3745e48...aa39b34'
const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');
console.log(key.toString('hex')); // '3745e48...08d59ae'
```
An array of supported digest functions can be retrieved using

Loading…
Cancel
Save