Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hash-stream

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hash-stream

Get a hash of a file or a stream

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
463
increased by26.16%
Maintainers
2
Weekly downloads
 
Created
Source

Hash Stream

NPM version Build status Test coverage Dependency Status License Downloads

Simple wrapper around crypto.createHash() for files and streams.

Installation

$ npm install hash-stream

API

var getHash = require('hash-stream')

getHash(filename || stream, algorithm, callback)

  • filename - path of the file
  • stream - a readable stream
  • algorithm - any defined by crypto.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')
})

CLI

You can use nhash to hash a file and get the output instantly. The usage options are simple:

$ nhash --help
Usage: nhash [options] [file]

Options:

  -h, --help              output usage information
  -V, --version           output the version number
  -a, --algorithm <sha1>  the hash alorithm
  -e, --encoding <hex>    the encoding of output

Keywords

FAQs

Package last updated on 28 Feb 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc