Closed matianfu closed 5 years ago
It's not yet possible. That would require keeping the C++ digest context alive across multiple update
calls, a mutex to ensure that only one thread operates on the C++ digest context at a time, and a garbage collection mechanism to free the C++ digest context when the corresponding javascript instance is collected. It's more complicated than an async function call. I think it can be done but I can't look into it right away. Hopefully someone can help out with this.
@matianfu I'm going to close this, since streaming carries overhead and is one of our non-goals.
It would complicate @ronomon/crypto-async to add support for streaming. Perhaps one day, but I will re-open this then if that's fine with you.
It seems that in current version only a single buffer could be hashed. I want to use it to hash a file stream, like the built-in hash function in crypto module, where
update
can be called multiple times. Is it possible?