many-file-hashes
Get the hashes of multiple files.
Uses path to resolve file path.
use
Simplest use is like this (outputs sha1
hashes in hex
encoding):
var manyHashes =
first param
You can pass in any of these as the first parameter:
string
: which is interpreted is a single filearray
: which is interpreted as a list of filesobject
: which is an options object, see below
not supported
Does not do recursive directory walking.
Must be actual files.
Use something like glob to walk directories.
all options
The first parameter can be an object, with the following optional parameters, like this:
var manyHashes = var options = files: './file.ext' // an array of *files* (directories not supported) encoding: 'base64' // any node.js encoding type: http://nodejs.org/docs/v0.4.9/api/crypto.html#hash.digest hash: 'sha512' // any node.js hash type: http://nodejs.org/docs/v0.4.9/api/crypto.html#crypto.createHash cwd: '.' // current working directory, used to resolve file
license
Released under the Very Open License (VOL).