2.0.0 • Published 11 years ago
hash-stream-simple v2.0.0
Hash Stream
Simple wrapper around crypto.createHash() for files and streams.
Same as hash-stream without the Promise dependency
Installation
$ npm install hash-stream-simpleAPI
var getHash = require('hash-stream-simple')getHash(filename || stream, algorithm, callback)
filename- path of the filestream- a readable streamalgorithm- any defined bycrypto.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')
})License
MIT
Originally authored by Jonathan Ong (@jonathanong)
2.0.0
11 years ago