You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

15 lines
367 B

#!/usr/bin/env node
var fs = require('fs')
var shasum = require('.')
var input = process.argv[2]
if (input && input !== '-') {
console.log(shasum(fs.readFileSync(input)))
} else {
var buffers = []
process.stdin.on('data', function (chunk) { buffers.push(chunk) })
process.stdin.on('end', function () {
console.log(shasum(Buffer.concat(buffers)))
})
}