Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

hash-stream-promise

wal2ISC1.0.1

Hash the content from a readable stream into a fingerprint hash

hash, stream

readme

hash-stream

This module takes content of a readable stream and creates a fingerprint hash for it.

npm install hash-stream-promise

Usage

var hasher = require('hash-stream-promise')
var fs = require('fs')

var stream = fs.createReadStream('file')

hasher(stream)
  .then(hash => {
    console.log('this is the hash', hash)
  })
  .catch(err => {
    console.log('handle error', err)
  })

API

hasher(stream, [algorithm])

Default algorithm is 'sha256', you can use any other valid one like sha512, etc. The function returns a Promise object that is resolved with the file hash.