doc: correct crypto.randomFill() and randomFillSync()#21550
Closed
Flarna wants to merge 3 commits intonodejs:masterfrom
Flarna:doc_crypto_randomfill
Closed
doc: correct crypto.randomFill() and randomFillSync()#21550Flarna wants to merge 3 commits intonodejs:masterfrom Flarna:doc_crypto_randomfill
Flarna wants to merge 3 commits intonodejs:masterfrom
Flarna:doc_crypto_randomfill
Conversation
9 tasks
addaleax
reviewed
Jun 27, 2018
doc/api/crypto.md
Outdated
Member
There was a problem hiding this comment.
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?
Member
Author
There was a problem hiding this comment.
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.
7 tasks
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)`.
addaleax
approved these changes
Jul 18, 2018
Member
BridgeAR
approved these changes
Jul 18, 2018
Member
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM even though I wonder if we should explain the example at least once?
jasnell
approved these changes
Jul 18, 2018
Member
|
Landed in acc633c |
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>
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 was referenced Aug 16, 2018
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Correct return type of
crypto.randomFillSync()which is of same type as passed asbufferargument.Correct samples for
randomFill()andrandomFillSync()using aTypeArrayorDataViewas these types don't support.toString(encoding).