To get file hash from buffer in Node.js, we can use the built-in crypto
module.
Here's an example:
433 chars16 lines
This example uses the sha256
algorithm to calculate the file hash. You can replace it with the algorithm you need (md5
, sha1
, sha512
, etc.).
gistlibby LogSnag