FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

doc: correct crypto.randomFill() and randomFillSync() by Flarna · Pull Request #21550 · nodejs/node · GitHub

/ node Public

doc: correct crypto.randomFill() and randomFillSync() - #21550

Closed
Flarna wants to merge 3 commits into
nodejs:masterfrom
Flarna:doc_crypto_randomfill
Closed

doc: correct crypto.randomFill() and randomFillSync()#21550
Flarna wants to merge 3 commits into
nodejs:masterfrom
Flarna:doc_crypto_randomfill

Conversation

Flarna commented Jun 26, 2018

Copy link
Copy Markdown
Member

Correct return type of crypto.randomFillSync() which is of same type as passed as buffer argument.

Correct samples for randomFill() and randomFillSync() using a TypeArray or DataView as these types don't support .toString(encoding).

nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. doc Issues and PRs related to the documentations. labels Jun 26, 2018
Comment thread doc/api/crypto.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Just using .buffer works in these cases, but I’m not sure we should include it in our documentation like this – most of the time when you’re doing this, you’ll want to consider .byteLength and .byteOffset as well?

Flarna Jun 27, 2018
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I just modified the samples to work without thinking to much about it. Printing a Float64Array formatted as 'hex' is usually not a typical use. I will update the samples to use also .byteLength and .byteOffset but I'm not sure if doc of randomFillSync() is the right place to show how to work with typed arrays.

Flarna added 3 commits July 12, 2018 21:02
Correct return type of `crypto.randomFillSync()` which is of same type as
passed as `buffer` argument.

Correct samples for `randomFill()` and `randomFillSync()` using a `TypeArray`
or `DataView` as these types don't support `.toString(encoding)`.

Copy link
Copy Markdown
Member

addaleax added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Jul 18, 2018

BridgeAR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM even though I wonder if we should explain the example at least once?

trivikr commented Aug 5, 2018

Copy link
Copy Markdown
Member

Landed in acc633c

trivikr closed this Aug 5, 2018
trivikr pushed a commit that referenced this pull request Aug 5, 2018
Correct return type of `crypto.randomFillSync()` which is of same type as
passed as `buffer` argument.

Correct samples for `randomFill()` and `randomFillSync()` using a `TypeArray`
or `DataView` as these types don't support `.toString(encoding)`.

PR-URL: #21550
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Flarna deleted the doc_crypto_randomfill branch August 5, 2018 19:47
targos pushed a commit that referenced this pull request Aug 6, 2018
Correct return type of `crypto.randomFillSync()` which is of same type as
passed as `buffer` argument.

Correct samples for `randomFill()` and `randomFillSync()` using a `TypeArray`
or `DataView` as these types don't support `.toString(encoding)`.

PR-URL: #21550
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 outstanding review comments, 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.

6 participants


Back | FazBrowse Home | New Git URL