Given a readable stream, calls a callback with the hash of the data
MIT License
Given a readable stream, calls a callback with the hash of the data.
var fs = require('fs')
var hasher = require('hash-of-stream')
var file = fs.createReadStream(__filename)
hasher(file, function (hash) {
console.log('The hash of %s is %s', __filename, hash)
})
hasher(stream, [algorithm], callback)
stream
must be a readable streamalgorithm
is optional and will default to sha256
callback
will be called with the hash of the data in the givenMIT