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!(hash): use node:crypto when possible #100

Merged
merged 6 commits into from
Feb 18, 2025
Merged

perf!(hash): use node:crypto when possible #100

merged 6 commits into from
Feb 18, 2025

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jan 13, 2025

ohash uses a built-in js implementation of sha256 (based on crypto-js) since portability and support for Browsers were the main goal.

With #41, I have experimented SubtleCrypto.digest however async functions seem not to have significant (general) improvements.

This PR uses a different approach of using export conditions with ohash/crypto to switch between Node and JS implementations for hash.

BREAKING CHANGE is mainly a precaution.

@pi0 pi0 marked this pull request as ready for review February 18, 2025 23:30
@pi0 pi0 merged commit c280a0d into main Feb 18, 2025
2 checks passed
@pi0 pi0 deleted the perf/crypto-native branch February 18, 2025 23:30
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.

1 participant