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

crypto: add sync methods, deprecate optional callbacks #189

Closed
wants to merge 1 commit into from
Closed

crypto: add sync methods, deprecate optional callbacks #189

wants to merge 1 commit into from

Conversation

jonathanong
Copy link
Contributor

See #5

  • would you like me to add/change tests?
  • didn't bother disallowing callbacks in the sync version. after all this is about the public API. is that something you guys want?
  • want doc updates?
  • only changed .randomBytes() and .pseudoRandomBytes(). were there others?

@piscisaureus
Copy link
Contributor

I like this. @iojs/tc

@trevnorris
Copy link
Contributor

+1

@ruimarinho
Copy link

Someone mentioned on another issue (I can't find right now) that we should consider aligning our crypto API with the WebCryptoAPI, specifically using getRandomValues. I think it was an excellent idea. Would this be the moment to consider it?

@trevnorris
Copy link
Contributor

@ruimarinho Since 1.0.0-alpha is pushing for release, not right now. Though if there's not an official issue open asking for it then the issue should be created.

@piscisaureus
Copy link
Contributor

@jonathanong

only changed .randomBytes() and .pseudoRandomBytes(). were there others?

Yes, crypto.pbkdf2
Edit: I'm actually no so sure the callback is optional there.

exports.pseudoRandomBytes = util.deprecateSync(pseudoRandomBytes, '`crypto.pseudoRandomBytes(size)` is deprecated. Please use `crypto.pseudoRandomBytesSync(size)` instead.');
exports.pseudoRandomBytesSync = pseudoRandomBytes;

exports.rng = util.deprecateSync(randomBytes, '`crypto.rng(size)` is deprecated. Please us `crypto.rngSync(size)` instead.');
Copy link
Contributor

Choose a reason for hiding this comment

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

“Please us” → “Please use” for these last two messages.

@jonathanong
Copy link
Contributor Author

what's the status on this? if desired, i can rebase and reopen for v1.x

@brendanashworth
Copy link
Contributor

I'm pretty sure doc updates would be a necessity to merge this in, but I don't believe a rebase and reopen is necessary, as a contributor would merge it manually anyways (unless there are merge conflicts). I could be corrected on that.

syg pushed a commit to syg/node that referenced this pull request Jun 20, 2024
…s#186) (nodejs#189)

* Fix test-http-server-keepalive-req-gc

* Format

---------

Co-authored-by: Etienne Pierre-Doray <etipdoray@gmail.com>
Co-authored-by: Etienne Pierre-doray <etiennep@chromium.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants