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
{{ message }}
Repository navigation
Hash.prototype._flush does not set state[kFinalized] #38727
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?
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! :)
Activity
tniessen commentedon Apr 2, 2022
I believe this is to enable piping into a
Hashobject but still being able to calldigest()to obtain the hash value instead of reading from theHashobject using the stream API, whereas callingdigest()multiple times is usually unnecessary and might indicate a bug.Possibly related: #28251
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! :)