package
pull-stream API for hashing data
npm install pull-hashGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
crypto hash API using pull-streams
var hash = require('pull-hash')
var pull = require('pull-stream')
pull(
source,
hash('sha256', 'hex', function (err, sum) {
console.log('shasum:', sum)
}),
pull.drain()
)var hash = require('pull-hash')hash(type[, encoding], onEnd): throughCreate a through stream that hashes the data and calls onEnd when it is done.
type: crypto.Hash object, or string to pass to crypto.createHash, e.g.
"sha256"encoding: encoding for the digest to pass to Hash.digest()onEnd(err, digest): callback with digest when stream is ended or erroredvar gitHash = require('pull-hash/ext/git')gitHash(object[, encoding], onEnd): throughGet a git object id.
object.type: one of ["commit", "tree", "blob", "tag"]object.length || object.size: size in bytes of the git object's datavar ssbHash = require('pull-hash/ext/ssb')ssbHash(onEnd): throughGet a hash id of a secure-scuttlebutt blob.
Copyright (c) 2016 Charles Lehner
Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.
DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.