sha

sha512sum

💾 💿 The same behaviour as linux command with directories support. https://linux.die.net/man/1/sha512sum.

Showing:

Popularity

Downloads/wk

2

GitHub Stars

2

Maintenance

Last Commit

4yrs ago

Contributors

3

Package

Dependencies

4

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

sha512sum

npm version NPM downloads Build Status Build Status Codacy Coverage Codacy Grade JavaScript Style Guide

The same behaviour as linux command with directories support. https://linux.die.net/man/1/sha512sum

Works on Linux and Windows.

Install

$ npm install --save sha512sum

Usage

For a file

const sha512sum = require('sha512sum');

// 992 ... 80a  /path/to/file
sha512sum.fromFile('/path/to/file', options, function(err, hash) {
  if (err) throw err
  console.log(hash)
});

console.log(sha512sum.fromFileSync('/path/to/file', options))

Similar to linux command:

$ sha512sum /path/to/file

For a directory

const sha512sum = require('sha512sum');

// 992 ... 80a  /path/to/dir/h.txt
// erf ... e3f  /path/to/dir/b/e.doc
// cd5 ... r9g  /path/to/dir/b/l.png
// b2r ... v2f  /path/to/dir/c/l.csv
// adr ... 9t6  /path/to/dir/d/o.world
sha512sum.fromDirectory('/path/to/dir', options, function(err, hash) {
  if (err) throw err
  console.log(hash)
});

console.log(sha512sum.fromDirectorySync('/path/to/dir', options))

Similar to linux command:

$ find files -type f -printf "%d%p\n" | sort -n | cut -c 2- | xargs sha512sum

Options

  • cwd: current work directory
  • sep: separator between hash and filename, default value is double-space

License

MIT © Léo Lozach

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial