New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

hash-transform

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hash-transform

allows user to create a hash from an input stream as well as pipe stream to next input

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

hash-transform

Hash transform that creates a hash (checksum) from an input stream leaving stream unchanged and is then able to be piped to input of another stream.

hash-transform is written in ecma6 so I would recommend running nodejs v4.0 or greater (no harmony flag needed)

installation

$ npm install hash-transform

##test

$ npm test

usage

###constructor

new HashTransform(algorithm[, encoding]);

###hashing file stream


var HashTransform = require('hash-transform');
var path = require('path');
var fs = require('fs');

var file = path.resolve('./test/data/test.txt');
var alg = 'sha256';

var hash = new HashTransform(alg);
var fi = fs.createReadStream(file);

fi.pipe(hash).pipe(process.stdout);

hash.on('end', function(){
	console.log(hash.hash);	
});

license

MIT

Keywords

hash

FAQs

Package last updated on 05 Dec 2015

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