$ gnpm install sha
Check and get file hashes (using any algorithm)
$ npm install sha
Asynchronously check that fileName has a "hash" of expected. The callback will be called with either null or an error (indicating that they did not match).
Options:
sha1 and can be any of the algorithms supported by crypto.createHashAsynchronously get the "hash" of fileName. The callback will be called with an optional error object and the (lower cased) hex digest of the hash.
Options:
sha1 and can be any of the algorithms supported by crypto.createHashCheck the hash of a stream without ever buffering it. This is a pass through stream so you can do things like:
fs.createReadStream('src')
.pipe(sha.stream('expected'))
.pipe(fs.createWriteStream('dest'))
dest will be a complete copy of src and an error will be emitted if the hash did not match 'expected'.
Options:
sha1 and can be any of the algorithms supported by crypto.createHashYou may use this software under the BSD or MIT. Take your pick. If you want me to release it under another license, open a pull request.
Copyright 2013 - present © cnpmjs.org | Home |