How To Get The Hash of A File In Node.js
Briefly

We will use the fs and crypto modules that are available in Node.js to get the hash of a file. We will be using the createReadStream method of the fs module to read the file and get its contents. After we are done reading it, we will call the the getHash() method of the crypto module to calculate the hash of the file.
sha256 would be the more robust algorithm but a bit slower than the other less secure ones. For the digest method, we could have used hex or base64 depending on how we want to output the hash.
Read at Wisdom Geek
[
add
]
[
|
|
]