hash-stream-simple

2.0.0 • Public • Published

Hash Stream

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

Same as hash-stream without the Promise dependency

Installation

$ npm install hash-stream-simple

API

var getHash = require('hash-stream-simple')

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')
})

License

MIT

Originally authored by Jonathan Ong (@jonathanong)

Readme

Keywords

Package Sidebar

Install

npm i hash-stream-simple

Weekly Downloads

1

Version

2.0.0

License

MIT

Last publish

Collaborators

  • jb55