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 and modernize code examples in crypto.md #10909

Closed
wants to merge 8 commits into from
Closed

doc: fix and modernize code examples in crypto.md #10909

wants to merge 8 commits into from

Conversation

vsemozhetbyt
Copy link
Contributor

Checklist
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

doc, crypto

  • var -> const / let.
  • Fix error in code example (basing on the previous example).
  • equal -> strictEqual, == -> ===.
  • Update estimated outputs in code example comments.
  • snake_case -> camelCase (unlike method signatures, examples mostly use camelCase).
  • Concatenation -> multiline template.
  • Add missing line break in code example (the code throws currently; fixed basing on the history).
  • Add missing link reference.

@nodejs-github-bot nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. doc Issues and PRs related to the documentations. lts-watch-v6.x labels Jan 20, 2017
@@ -541,7 +541,7 @@ const bob_key = bob.generateKeys();
const alice_secret = alice.computeSecret(bob_key);
const bob_secret = bob.computeSecret(alice_key);

assert(alice_secret, bob_secret);
assert.equal(alice_secret.toString('hex'), bob_secret.toString('hex'));
Copy link
Member

@lpinca lpinca Jan 21, 2017

Choose a reason for hiding this comment

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

Nit: assert.strictEqual()? Not sure if it is preferred on doc examples.

Edit: nvm fixed in next commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the confusion, I've tried to do it step by step and to split by topics)

Copy link
Member

@lpinca lpinca left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for splitting into multiple commits to simplify the review.

@jasnell
Copy link
Member

jasnell commented Jan 23, 2017

/cc @nodejs/crypto

@vsemozhetbyt
Copy link
Contributor Author

vsemozhetbyt commented Jan 24, 2017

/cc @nodejs/documentation

Copy link
Contributor

@sam-github sam-github left a comment

Choose a reason for hiding this comment

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

OK. Will all the examples still run on 4.x?

@jasnell
Copy link
Member

jasnell commented Jan 24, 2017

I see no reason why they would not.

@sam-github
Copy link
Contributor

I appreciate the breakdown of the PR into small commits, we should squash before landing, though.

@sam-github
Copy link
Contributor

And that's 5 days and two approvals, @vsemozhetbyt you are good to land.

jasnell pushed a commit that referenced this pull request Jan 24, 2017
* var -> const / let in crypto.md
* fix error in crypto.md code example
* equal -> strictEqual, == -> === in crypto.md
* update estimated outputs in crypto.md
* snake_case -> camelCase in crypto.md examples
* concatenation -> multiline template in crypto
* add missing line break in crypto code example
* add missing link reference in crypto.md

PR-URL: #10909
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell
Copy link
Member

jasnell commented Jan 24, 2017

Landed in squashed commit 3e9c8ef

@jasnell jasnell closed this Jan 24, 2017
@vsemozhetbyt vsemozhetbyt deleted the crypto.md branch January 24, 2017 18:57
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 24, 2017
* var -> const / let in crypto.md
* fix error in crypto.md code example
* equal -> strictEqual, == -> === in crypto.md
* update estimated outputs in crypto.md
* snake_case -> camelCase in crypto.md examples
* concatenation -> multiline template in crypto
* add missing line break in crypto code example
* add missing link reference in crypto.md

PR-URL: nodejs#10909
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 27, 2017
* var -> const / let in crypto.md
* fix error in crypto.md code example
* equal -> strictEqual, == -> === in crypto.md
* update estimated outputs in crypto.md
* snake_case -> camelCase in crypto.md examples
* concatenation -> multiline template in crypto
* add missing line break in crypto code example
* add missing link reference in crypto.md

PR-URL: nodejs#10909
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@italoacasas italoacasas mentioned this pull request Jan 29, 2017
MylesBorins pushed a commit that referenced this pull request Mar 7, 2017
* var -> const / let in crypto.md
* fix error in crypto.md code example
* equal -> strictEqual, == -> === in crypto.md
* update estimated outputs in crypto.md
* snake_case -> camelCase in crypto.md examples
* concatenation -> multiline template in crypto
* add missing line break in crypto code example
* add missing link reference in crypto.md

PR-URL: #10909
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Mar 9, 2017
* var -> const / let in crypto.md
* fix error in crypto.md code example
* equal -> strictEqual, == -> === in crypto.md
* update estimated outputs in crypto.md
* snake_case -> camelCase in crypto.md examples
* concatenation -> multiline template in crypto
* add missing line break in crypto code example
* add missing link reference in crypto.md

PR-URL: #10909
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Mar 9, 2017
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.

6 participants