Post
ugh why isn't this documented better in nodejs.org/api/crypto.h... this is so much nicer!
nodejs.orgCrypto | Node.js v25.9.0 Documentation
It is documented and explains a bit, but not well known: > It can be faster than the object-based crypto.createHash() when hashing a smaller amount of data (<= 5MB) that's readily available. If the data can be big or if it is streamed, it's still recommended to use crypto.createHash() instead.
0 reposts2 likes
they should put a note directing to hash() under nodejs.org/api/crypto.h... with the aforementioned benefits/drawbacks ideally
nodejs.orgCrypto | Node.js v25.9.0 Documentation
Good call, lets update the docs github.com/nodejs/node/...
github.comdoc: mention crypto.hash() for better perf by styfle · Pull Request #63420 · nodejs/nodeThe docs on crypto.hash() already mentioned why you would use it over crypto.createHash().
This PR adds the reverse so that the docs on crypto.createHash() mention why you would use crypto.hash().