1.0.0 • Published 9 years ago
hash-file-cli v1.0.0
hash-file-cli
Create hash from file. CLI for hash-file
Install
npm i hash-file --save
npm test
API
For more use-cases see the tests. You also can use it as
hash-file
.
var hashFile = require('hash-file-cli')
hashFile('./package.json', function (err, hash) {
console.log(hash)
//=> 'c32f3a677ba94c51e2a0123e3f18caccb7d5fb6ce5ea6d61b2ff816200004426a5dbb73bb7ab2f607ed18f3e63476c785c48341e8645193cd1f7b842ed1adaee'
})
hashFile('./package.json', {algorithm: 'sha1'} function (err, hash) {
console.log(hash)
//=> '5baa798212ebfa71da5b0e0b8287220ed54e56b2'
})
CLI
Just run
npm i -g hash-file
to install it globally.
$ hash-file --help
Usage
$ hash-file <file>
$ cat <file> | hash-file
Example
$ hash-file unicorn.jpg --algorithm=md5
1abcb33beeb811dca15f0ac3e47b88d9
Options
--algorithm Cipher algorithm: md5,sha1,sha256,sha512 Default: sha512s
--encoding Output encoding: hex,base64,buffer,binary Default: hex
Related
- Hasha: A Friendly Crypto API • DailyJS
- hasha: Hashing made simple. Get the hash of a buffer/string/stream/file.
- hasha-cli: Hashing made simple. CLI for
hasha
module. You can use also as API forhasha
. - hash-file: Create a hashed file name
- hash-obj: Get the hash of an object
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.