🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

fixed-size-chunk-hashing

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

fixed-size-chunk-hashing

Hash a stream to fixed size chunks

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

fixed-size-chunk-hashing

Hash a stream to fixed size chunks

npm install fixed-size-chunk-hashing

Usage

var hash = require('fixed-size-chunk-hashing')
var fs = require('fs')

fs.createReadStream('some-file').pipe(hash(512 * 1024, function (err, hashes) {
  if (err) throw err

  // hashes is a list of the file hashes
  console.log(hashes)
}))

API

var stream = hash(size, [options], [callback])

Create a new fixed size chunking hash stream. Size if the byte size of the chunks (the last chunk might be less than this size). Callback is called with callback(err, listOfHashes) if you provide it and the list of hashes is also returned as a stream.

License

MIT

FAQs

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