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

perf: use crypto.hash when available #18317

Merged

Conversation

sapphi-red
Copy link
Member

Description

crypto.hash seems to be faster than crypto.createHash and it also makes the code more simple (when we can drop the polyfill part).
https://nodejs.org/docs/latest-v20.x/api/crypto.html#cryptohashalgorithm-data-outputencoding

@sapphi-red sapphi-red added the p2-nice-to-have Not breaking anything but nice to have (priority) label Oct 10, 2024
Copy link

stackblitz bot commented Oct 10, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Rare node W 😄

@patak-dev patak-dev merged commit 2a14884 into vitejs:main Oct 10, 2024
12 checks passed
@sapphi-red sapphi-red deleted the perf/use-crypto-hash-when-available branch October 10, 2024 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants