1.0.0 • Published 6 years ago

sha256-file v1.0.0

Weekly downloads
58,272
License
MIT
Repository
github
Last release
6 years ago

sha256-file

Simply return an sha256 sum of a given file. If using async version (by including callback), it will stream; successfully tested on files 4 GB+.

Installation

$ npm install sha256-file

Test:

$ npm test

API

sha1File(path, callback)

var sha256File = require('sha256-file');

// sync (no callback)

sha256File('./path/to/a_file'); // '345eec8796c03e90b9185e4ae3fc12c1e8ebafa540f7c7821fb5da7a54edc704'

// async/streamed (if using callback)

sha256File('./path/to/a_file', function (error, sum) {
  if (error) return console.log(error);
  console.log(sum) // '345eec8796c03e90b9185e4ae3fc12c1e8ebafa540f7c7821fb5da7a54edc704'
})

License

MIT

Thanks

sha256-file is based on sha1-file