diff options
author | 2020-11-18 23:26:45 +0100 | |
---|---|---|
committer | 2020-11-18 23:26:45 +0100 | |
commit | 81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch) | |
tree | 8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/sha.js/bin.js | |
parent | 1870f3fdf43707a15fda0f609a021f516f45eb63 (diff) | |
download | website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2 website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip |
rm node_modules
Diffstat (limited to 'node_modules/sha.js/bin.js')
-rwxr-xr-x | node_modules/sha.js/bin.js | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/node_modules/sha.js/bin.js b/node_modules/sha.js/bin.js deleted file mode 100755 index 5a7ac83..0000000 --- a/node_modules/sha.js/bin.js +++ /dev/null @@ -1,41 +0,0 @@ -#! /usr/bin/env node - -var createHash = require('./browserify') -var argv = process.argv.slice(2) - -function pipe (algorithm, s) { - var start = Date.now() - var hash = createHash(algorithm || 'sha1') - - s.on('data', function (data) { - hash.update(data) - }) - - s.on('end', function () { - if (process.env.DEBUG) { - return console.log(hash.digest('hex'), Date.now() - start) - } - - console.log(hash.digest('hex')) - }) -} - -function usage () { - console.error('sha.js [algorithm=sha1] [filename] # hash filename with algorithm') - console.error('input | sha.js [algorithm=sha1] # hash stdin with algorithm') - console.error('sha.js --help # display this message') -} - -if (!process.stdin.isTTY) { - pipe(argv[0], process.stdin) -} else if (argv.length) { - if (/--help|-h/.test(argv[0])) { - usage() - } else { - var filename = argv.pop() - var algorithm = argv.pop() - pipe(algorithm, require('fs').createReadStream(filename)) - } -} else { - usage() -} |