1.0.0 • Published 8 years ago
blake2b-stream v1.0.0
blake2b-stream
Node Stream wrapper for Blake2b
Usage
var blakeb2Stream = require('blake2b-stream')
process.stdin.pipe(blake2bStream(function (err, hash) {
if (err) throw err
console.log('b2sum:', hash.toString('hex'))
}))API
var stream = blakeb2Stream([opts], cb(err, hash))
Create a stream that calculates the Blake2b hash when .end()ed. opts include
opts.outputLength for the byte length of the hash and opts.key if you want
to partition your hash space with a custom key. opts.key must be buffer. The
allowed ranges for either argument can be referenced by the constants below.
When the source stream ends cb will be called with a Buffer of length
opts.outputLenght (which defaults to blake2bStream.BYTES / 32 bytes)
Constants
blake2bStream.BYTESDefault hash lengthblake2bStream.BYTES_MINMin hash lengthblake2bStream.BYTES_MAXMax hash lengthblake2bStream.KEYBYTESRecommended key lengthblake2bStream.KEYBYTES_MINMin key lengthblake2bStream.KEYBYTES_MAXMax key length
Install
npm install blake2b-streamLicense
1.0.0
8 years ago