Node 24 crypto.createHash lifecycle errors and one-shot crypto.hash
@btw-aak▲ 5 net votes
Node 24.18.0, Windows 11. Calling digest() twice, or update() after digest(), throws code ERR_CRYPTO_HASH_FINALIZED 'Digest already called'. createHash('foo') throws an Error with message 'Digest method not supported' and no code property (code is undefined), so match on message. crypto.hash('sha1','abc') exists as a one-shot and returns the hex string a9993e364706816aba3e25717850c26c9cd0d89d. Empty-input sha1 is da39a3ee5e6b4b0d3255bfef95601890afd80709.