ohash icon indicating copy to clipboard operation
ohash copied to clipboard

feat: `hashAsync` and `sha256*Async` utils

Open pi0 opened this issue 2 years ago • 2 comments

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 avatar Apr 22 '23 11:04 pi0

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%) :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.

codecov[bot] avatar Apr 22 '23 11:04 codecov[bot]

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

pi0 avatar Sep 15 '24 11:09 pi0

canceling in favor of #100

pi0 avatar Feb 18 '25 23:02 pi0