Skip to content

Instantly share code, notes, and snippets.

@zoutepopcorn
Created September 28, 2017 13:06
Show Gist options
  • Save zoutepopcorn/00d129df72f194a93559c79f62e2cada to your computer and use it in GitHub Desktop.
Save zoutepopcorn/00d129df72f194a93559c79f62e2cada to your computer and use it in GitHub Desktop.
var fs = require('fs');
var md5 = require('md5');
var dir = __dirname + "\\uploads";
console.log(dir);
var test = "hi there";
fs.readdir(dir, function(err, items) {
console.log(test);
for (var i=0; i<items.length; i++) {
var pad = dir + "\\" + items[i];
console.log(items[i]);
var text = fs.readFileSync(pad,'utf8')
console.log (md5(text));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment