Skip to content

watson/hash-of-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hash-of-stream

Given a readable stream, calls a callback with the hash of the data.

Build status js-standard-style

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)
  • stream must be a readable stream
  • algorithm is optional and will default to sha256
  • callback will be called with the hash of the data in the given stream once the stream ends

License

MIT

About

Given a readable stream, calls a callback with the hash of the data

Resources

License

Stars

Watchers

Forks

Packages

No packages published