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

feat: hashAsync and sha256*Async utils #41

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

feat: hashAsync and sha256*Async utils #41

wants to merge 10 commits into from

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Apr 22, 2023

Resolves #25

Add a new asyncHash to leverage the native platform hashing mechanism using SubtleCrypto digest(). When not available, ohash falls back to js implementation.

Benchmarks:

local run node benchmark/hash.mjs

(with the exception of a few items, it is not faster, than investigating..)

@pi0 pi0 marked this pull request as draft April 22, 2023 11:45
@codecov
Copy link

codecov bot commented Apr 22, 2023

Codecov Report

Merging #41 (930c4d3) into main (9f2fd38) will increase coverage by 0.28%.
The diff coverage is 92.30%.

@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
+ Coverage   80.53%   80.81%   +0.28%     
==========================================
  Files           8        8              
  Lines         981     1006      +25     
  Branches      126      132       +6     
==========================================
+ Hits          790      813      +23     
- Misses        191      193       +2     
Impacted Files Coverage Δ
src/hash.ts 95.00% <92.00%> (-5.00%) ⬇️
src/index.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@pi0 pi0 changed the title feat: asyncHash with native sha256 digest and fallback feat: hashAsync with native sha256 digest and fallback Sep 15, 2024
@pi0
Copy link
Member Author

pi0 commented Sep 15, 2024

(update: renaming to hashAsync thanks to @danielroe idea)

@pi0 pi0 changed the title feat: hashAsync with native sha256 digest and fallback feat: hashAsync and sha256*Async utils Sep 15, 2024
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.

Support native hash using crypto
1 participant