-
Notifications
You must be signed in to change notification settings - Fork 4
Description
APIs proposed here address the problem of hashing / signing / verifying content that is too large to hold in memory, which is great. Unfortunately it does not address use cases where you need to do those operations incrementally e.g. when large stream of data is transferred over some channel you may want to send checksums along the way.
With the drafted API it would require replaying all the previous bytes. In contrast node's crypto APIs provide you with .copy() method on a hasher so you can continue writing into hasher.
Perhaps something along the same lines could be done here as well, e.g. instead of hashing / signing / verifying readable stream, one could create hasher / signer / verifier instance from readable stream, with a method method digest / sign / verify to compute result for the bytes that had been written so far.