Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Fix pbkdf2 example #16203

Closed
wants to merge 1 commit into from
Closed

doc: Fix pbkdf2 example #16203

wants to merge 1 commit into from

Conversation

lboecker
Copy link

512 bytes seems like a lot. See #3415

@nodejs-github-bot nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. doc Issues and PRs related to the documentations. labels Oct 14, 2017
@hiroppy
Copy link
Member

hiroppy commented Oct 15, 2017

/cc @nodejs/crypto

Copy link
Member

@tniessen tniessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nits addressed

@@ -1616,7 +1616,7 @@ 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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to change this value as well (the first bytes should still be the same, but the last bytes will most likely be different).

@@ -1668,7 +1668,7 @@ Example:

```js
const crypto = require('crypto');
const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512');
const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');
console.log(key.toString('hex')); // '3745e48...aa39b34'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@lboecker
Copy link
Author

@tniessen I've updated the output. Shame on me for assuming it was outdated anyway.

@tniessen
Copy link
Member

Landed in b5c74d8, thank you for your contribution! 🎉

@tniessen tniessen closed this Oct 16, 2017
tniessen pushed a commit that referenced this pull request Oct 16, 2017
PR-URL: #16203
Refs: #3415
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@lboecker lboecker deleted the doc branch October 16, 2017 16:11
targos pushed a commit that referenced this pull request Oct 18, 2017
PR-URL: #16203
Refs: #3415
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Oct 18, 2017
PR-URL: nodejs/node#16203
Refs: nodejs/node#3415
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Issues and PRs related to the crypto subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants