package
Get a hash of a file or a stream
npm install hash-streamGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 3 packages.
202.2 kB
Includes dependencies.
Simple wrapper around crypto.createHash() for files and streams.
$ npm install hash-streamvar getHash = require('hash-stream')filename - path of the filestream - a readable streamalgorithm - any defined by crypto.getHashes()Returns a hash as a raw Buffer, so if you want a hex:
getHash('image.png', 'sha256', function (err, hash) {
hash = hash.toString('hex')
})You can use nhash to hash a file and get the output instantly. The usage options are simple:
$ nhash --help
Usage: nhash [options] [file]
Options:
-h, --help output usage information
-V, --version output the version number
-a, --algorithm <sha1> the hash alorithm
-e, --encoding <hex> the encoding of outputdougwilson
doug@somethingdoug.com