1.0.0 • Published 9 years ago
hash-of-stream v1.0.0
hash-of-stream
Given a readable stream, calls a callback with the hash of the data.
Usage
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)
})API
hasher(stream, [algorithm], callback)streammust be a readable streamalgorithmis optional and will default tosha256callbackwill be called with the hash of the data in the given stream once the stream ends
License
MIT
1.0.0
9 years ago