GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Deprecate mixed async crypto by jonathanong · Pull Request #2170 · nodejs/node

Conversation

@jonathanong

@jonathanong jonathanong commented Jul 12, 2015

Copy link
Copy Markdown
Contributor

deprecates async usage of .randomBytes()

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Fishrock123 Fishrock123 added the semver-minor PRs that contain new features and should be released in the next minor version. label Jul 12, 2015
@jonathanong jonathanong mentioned this pull request Jul 12, 2015
crypto: add sync methods, deprecate optional callbacks #632
Closed
1 task done
@Fishrock123

Fishrock123 commented Jul 12, 2015

Copy link
Copy Markdown
Contributor

Possibly waiting on #1704

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex mscdex added the crypto Issues and PRs related to the crypto subsystem. label Jul 12, 2015
@silverwind

silverwind commented Jul 14, 2015

Copy link
Copy Markdown
Contributor

@thefourtheye you had a suggestion about the deprecation rewrite, but I can't seem to find it in the mess that is #632. Could you elaborate again?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

silverwind
silverwind reviewed Jul 14, 2015
View reviewed changes
Comment thread lib/crypto.js Outdated

@silverwind silverwind Jul 14, 2015

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This should probably point to crypto.rngSync.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jonathanong

jonathanong commented Jul 14, 2015

Copy link
Copy Markdown
Contributor Author

updated with just the patch. running the tests locally right now

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jonathanong

jonathanong commented Jul 14, 2015

Copy link
Copy Markdown
Contributor Author

shouldn't it say, "used asynchronously"?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jonathanong

jonathanong commented Jul 14, 2015

Copy link
Copy Markdown
Contributor Author

your patch gave me lint errors :(

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thefourtheye

thefourtheye commented Jul 14, 2015

Copy link
Copy Markdown
Contributor

Sorry about that :(

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Jul 19, 2015

Copy link
Copy Markdown
Contributor

shouldn't it say, "used asynchronously"?

Yes, definitely more grammatically correct than "used as async", which makes no sense at all.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jonathanong
jonathanong reviewed Jul 19, 2015
View reviewed changes
Comment thread lib/crypto.js Outdated

@jonathanong jonathanong Jul 19, 2015

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

wait... i'm confused now. i don't see a randomBytesSync() function - I think I added that before but it's no longer relevant. removing this line.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jonathanong
crypto: deprecate async .randomBytes()
5913149
@silverwind

silverwind commented Jul 19, 2015

Copy link
Copy Markdown
Contributor

Linking #5 and #632.

So you went with not renaming the sync methods to randomBytesSync after all? Doesn't that somewhat contradict what you said in #5? What do we gain by just the deprecating the async usage?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jonathanong

jonathanong commented Jul 19, 2015

Copy link
Copy Markdown
Contributor Author

i can still add the Sync version but i don't see the point if we only support the sync version going forward (meaning no randomBytes()). having randomBytesSync() and no randomBytes() is kind of weird. up to you guys.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Jul 20, 2015

Copy link
Copy Markdown
Contributor

Hmm, looking trough #5, I can't seem to find any compelling reason why async randomBytes should be deprecated, except for the naming inconsistency. I'm not sure it's worth pushing the deprecation on users for that alone. I'm sorry, but I think this PR has no future because of that.

#5 (comment) might be a better reason to do a change to randomBytes, we should investigate if we can get closer to window.crypto in terms of API.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind silverwind closed this Jul 20, 2015
@jonathanong
jonathanong deleted the deprecate-mixed-async-crypto branch July 20, 2015 00:34
@Fishrock123

Fishrock123 commented Jul 20, 2015

Copy link
Copy Markdown
Contributor

@silverwind won't it almost always be instantaneous?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Jul 20, 2015

Copy link
Copy Markdown
Contributor

@Fishrock123 10MB of randomess take about 350ms on my Macbook, including process startup which is about 150ms, so yes - small number of bytes would be "instant".

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brendanashworth brendanashworth mentioned this pull request Jul 31, 2015
Consistent sync and async function names #5
Closed
@nwoltman nwoltman mentioned this pull request Jan 23, 2017
Should I use sync or async crypto.randomBytes in web server app nodejs/help#457
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

crypto Issues and PRs related to the crypto subsystem. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@jonathanong @Fishrock123 @silverwind @thefourtheye @mscdex
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.