ohash
ohash copied to clipboard
feat: `hashAsync` and `sha256*Async` utils
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..)
Codecov Report
Merging #41 (930c4d3) into main (9f2fd38) will increase coverage by
0.28%. The diff coverage is92.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%) |
:arrow_down: |
| 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.
(update: renaming to hashAsync thanks to @danielroe idea)
canceling in favor of #100