Simply return an
md5
sum of a given file. If using async version (by including callback), it will stream; successfully tested on files 4 GB+.
$ npm install md5-file
Test:
$ npm test
md5File(path, [callback])
var md5File = require('md5-file')
// sync (no callback)
md5File('./path/to/a_file') // '18e904aae79b5642ed7975c0a0074936'
// async/streamed (if using callback)
md5File('./path/to/a_file', function (error, sum) {
if (error) return console.log(error)
console.log(sum) // '18e904aae79b5642ed7975c0a0074936'
})
MIT