Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

sha256-file

so-ta303.3kMIT1.0.0TypeScript support: definitely-typed

return an sha256sum of a given file

sha256, sha256sum, checksum

readme

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