How to use the hasha.stream function in hasha

To help you get started, we’ve selected a few hasha examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sindresorhus / hasha-cli / cli.js View on Github external
alias: 'e'
		}
	}
});

const input = cli.input[0];

if (!input && process.stdin.isTTY) {
	console.log('Specify something to hash');
	process.exit(1);
}

if (input) {
	console.log(hasha(input, cli.flags));
} else {
	process.stdin.pipe(hasha.stream(cli.flags)).pipe(process.stdout);
}
github balena-os / jetson-flash / lib / utils.js View on Github external
const dirHash = dir => {
	return streamToString(
		tar.pack(dir).pipe(
			hasha.stream({
				algorithm: 'sha1',
			}),
		),
	);
};

hasha

Hashing made simple. Get the hash of a buffer/string/stream/file.

MIT
Latest version published 12 months ago

Package Health Score

74 / 100
Full package analysis