Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

hash-of-stream

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hash-of-stream

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

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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

Keywords

hash

FAQs

Package last updated on 17 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts