acdha / wasm-hashing

Experiment using Rust + WebAssembly to generate SHA-{1,2,3} hash implementations
https://acdha.github.io/wasm-hashing/
Other
5 stars 0 forks source link

Support a streaming interface #1

Open acdha opened 6 years ago

acdha commented 6 years ago

Right now everything is tested using a simple input(…) -> hex digest model. It'd be better to support streaming interfaces and possibly to do so in a way which would allow something like a File object to be passed in directly to avoid passing large data references around. Maybe something like hasher(expectedSize, callback) which could accept any function which will emit Uint8Arrays until exhausted?

acdha commented 6 years ago

This is partially complete in 6bb246dd7b1ab420aeacc8031a787b4df238002c but that's ugly due to https://github.com/rustwasm/wasm-bindgen/issues/329 currently and the code's memory usage should be reviewed.