Closed
Description
- Version: v16.1.0
- Platform: Darwin Kernel Version 20.4.0
- Subsystem: crypto
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()
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?