Skip to content

Commit

Permalink
Fix pbkdf2 example
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas committed Oct 15, 2017
1 parent 9aa41cb commit 2f387a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -1616,9 +1616,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'
});
```

Expand Down Expand Up @@ -1668,8 +1668,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
Expand Down

0 comments on commit 2f387a8

Please sign in to comment.