mirror of
https://github.com/zhigang1992/npm.git
synced 2026-05-18 01:42:01 +08:00
sha
Check and get file hashes (using any algorithm)
Installation
$ npm install sha
API
check(fileName, expected, [options,] cb)
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:
- algorithm: defaults to
sha1and can be any of the algorithms supported bycrypto.createHash
get(fileName, [options,] cb)
Asynchronously 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:
- algorithm: defaults to
sha1and can be any of the algorithms supported bycrypto.createHash
License
BSD

