You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the stream interface of hash it will call this[kHandle].digest() in Hash.prototype._flush. After that it is possible to call Hash.prototype.digest which will call this[kHandle].digest() again. If that is ok then why is Hash.prototype.digest made in a way that it is not possible to call it more than once?
How often does it reproduce? Is there a required condition?
What is the expected behavior?
What do you see instead?
Additional information
The text was updated successfully, but these errors were encountered:
I believe this is to enable piping into a Hash object but still being able to call digest() to obtain the hash value instead of reading from the Hash object using the stream API, whereas calling digest() multiple times is usually unnecessary and might indicate a bug.
I am going to close this since there has been no activity in quite a while and I don't think this is really a bug, but please do feel free to reopen or comment if you think this warrants more discussion! :)
What steps will reproduce the bug?
https://github.com/nodejs/node/blob/master/lib/internal/crypto/hash.js#L90-L93
When using the stream interface of hash it will call
this[kHandle].digest()
inHash.prototype._flush
. After that it is possible to callHash.prototype.digest
which will callthis[kHandle].digest()
again. If that is ok then why isHash.prototype.digest
made in a way that it is not possible to call it more than once?How often does it reproduce? Is there a required condition?
What is the expected behavior?
What do you see instead?
Additional information
The text was updated successfully, but these errors were encountered: