Hi, I’ve been using the crypto module and I wanted to ask if incremental/chunk hashing support could be added.
Right now crypto.hash() requires all data at once, which means large files need to be fully loaded into memory before hashing.
Would it be possible to expose a streaming/incremental hashing API similar to:
local digest = crypto.digest("sha256")
digest:update(chunk1)
digest:update(chunk2)
local hash = digest:final()
This would make it possible to hash very large files efficiently in chunks while keeping memory usage low.
It would also help with things like:
- duplicate file detection
- hashing large downloads
- streaming/network data
- backup utilities
Thanks for the great module.