I'm using this code to hash a single file:
const fs = require('fs');
let result = digest(fs.readFileSync('/users/ispedro/desktop/Test.PDF'));
console.log('Huella Digital MD5: ' + result)
I am trying to achieve the same but of all the files included in a folder, so that the output would be something like this:
The file (name of the file) generates the following MD5 hash: 175GKG3K6UZ6GAEE64BFKUN0MR
I have tried with various codes but have not succeeded ... any ideas please?
Update:
What I want to do is that the script reads the contents of a folder on the desktop without having to compress it in zip, so that I can remove or put files and when executing the script it returns the MD5 hash of those that are currently inside. I have tried to copy part of the code from this link npmjs.com/package/folder-hash which I think does exactly that but I can't get the script to work ...
Thank you very much to all.