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

Update for crypto.md #21500

Closed
wants to merge 3 commits into from
Closed

Update for crypto.md #21500

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 24, 2018

Description:

  • crypto.randomFillSync - update for JS example
  • crypto.scrypt, crypto.scryptSync - update for options description
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

crypto.randomFillSync - update for JS example
crypto.scrypt, crypto.scryptSync - update for options description
@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 Jun 24, 2018
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt left a comment

Choose a reason for hiding this comment

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

Thank you! Just some tiny nits.

@@ -2149,12 +2149,10 @@ added: v10.5.0
- `salt` {string|Buffer|TypedArray}
- `keylen` {number}
- `options` {Object}
- `N` {number} CPU/memory cost parameter. Must be a power of two greater
than one. **Default:** `16384`.
- `N` {number} CPU/memory cost parameter. Must be a power of two greater than one. **Default:** `16384`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, wrap long lines at 80 characters or less. Just align with the first list item character, like this:

  - `N` {number} CPU/memory cost parameter. Must be a power of two greater than
    one. **Default:** `16384`.

- `r` {number} Block size parameter. **Default:** `8`.
- `p` {number} Parallelization parameter. **Default:** `1`.
- `maxmem` {number} Memory upper bound. It is an error when (approximately)
`128*N*r > maxmem` **Default:** `32 * 1024 * 1024`.
- `maxmem` {number} Memory upper bound. It is an error when (approximately) `128*N*r > maxmem` **Default:** `32 * 1024 * 1024`.
Copy link
Contributor

Choose a reason for hiding this comment

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

The same)

Copy link
Contributor

@vsemozhetbyt vsemozhetbyt Jun 24, 2018

Choose a reason for hiding this comment

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

Maybe `128*N*r -> `128 * N * r for better readability?

@@ -2195,12 +2193,10 @@ added: v10.5.0
- `salt` {string|Buffer|TypedArray}
- `keylen` {number}
- `options` {Object}
- `N` {number} CPU/memory cost parameter. Must be a power of two greater
than one. **Default:** `16384`.
- `N` {number} CPU/memory cost parameter. Must be a power of two greater than one. **Default:** `16384`.
Copy link
Contributor

Choose a reason for hiding this comment

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

The same re wrapping.

- `r` {number} Block size parameter. **Default:** `8`.
- `p` {number} Parallelization parameter. **Default:** `1`.
- `maxmem` {number} Memory upper bound. It is an error when (approximately)
`128*N*r > maxmem` **Default:** `32 * 1024 * 1024`.
- `maxmem` {number} Memory upper bound. It is an error when (approximately) `128*N*r > maxmem` **Default:** `32 * 1024 * 1024`.
Copy link
Contributor

Choose a reason for hiding this comment

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

The same re wrapping and spaces.

crypto.scrypt, crypto.scryptSync - update for formatting
@ghost
Copy link
Author

ghost commented Jun 26, 2018

Done. Please check it.

@@ -2150,11 +2150,11 @@ added: v10.5.0
- `keylen` {number}
- `options` {Object}
- `N` {number} CPU/memory cost parameter. Must be a power of two greater
than one. **Default:** `16384`.
than one. **Default:** `16384`.
Copy link
Member

@tniessen tniessen Jun 26, 2018

Choose a reason for hiding this comment

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

Do we prefer this style @vsemozhetbyt? Seems like the current style causes issues when converted to HTML?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, the extra indentation produces false code blocks in HTML (not sure if this is per Markdown spec or just a quirk of marked we use in md-2-HTML conversion). See in the last nightly docs:

https://nodejs.org/download/nightly/v11.0.0-nightly201806268836a0d780/docs/api/crypto.html#crypto_crypto_scrypt_password_salt_keylen_options_callback

Copy link
Contributor

@vsemozhetbyt vsemozhetbyt left a comment

Choose a reason for hiding this comment

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

Just two nits that can be addressed on landing if it is not convenient to fix them now)

- `r` {number} Block size parameter. **Default:** `8`.
- `p` {number} Parallelization parameter. **Default:** `1`.
- `maxmem` {number} Memory upper bound. It is an error when (approximately)
`128*N*r > maxmem` **Default:** `32 * 1024 * 1024`.
`128 * N * r > maxmem` **Default:** `32 * 1024 * 1024`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for not spotting this first time: it seems we lack the period between maxmem` and **Default:**. Can you add it since we are already here?)

Copy link
Author

@ghost ghost Jun 26, 2018

Choose a reason for hiding this comment

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

@vsemozhetbyt "it seems we lack the period between maxmem and **Default:**" What do you mean on "period" word? Could you please write an example?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for the ambiguity) I mean we need this fix:

maxmem`. **Default:**

Copy link
Author

Choose a reason for hiding this comment

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

I see. Sure.

- `r` {number} Block size parameter. **Default:** `8`.
- `p` {number} Parallelization parameter. **Default:** `1`.
- `maxmem` {number} Memory upper bound. It is an error when (approximately)
`128*N*r > maxmem` **Default:** `32 * 1024 * 1024`.
`128 * N * r > maxmem` **Default:** `32 * 1024 * 1024`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto)

crypto.scrypt, crypto.scryptSync - added dot symbol
@ghost
Copy link
Author

ghost commented Jun 26, 2018

Please re-check it.

@vsemozhetbyt
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 26, 2018
vsemozhetbyt pushed a commit that referenced this pull request Jun 27, 2018
PR-URL: #21500
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
@vsemozhetbyt
Copy link
Contributor

Landed in 02fd93d
Thank you!

@ghost ghost deleted the patch-1 branch June 28, 2018 12:43
targos pushed a commit that referenced this pull request Jun 28, 2018
PR-URL: #21500
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
@targos targos mentioned this pull request Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. 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.

4 participants