FrogOS Build MD5sum
Generate a unique identifier for matched files within a given path.
$ npm install --save fos-build-md5sum
var fos-build-md5sum = new (require('fos-build-md5sum'))();
Configuration may be specified via the constructor or the prototype this.options()
method:
// Instantiation
var fos-build-md5sum = new (require('fos-build-md5sum'))({
pattern: '*.js'
});
// Runtime
fos-build-md5sum.options({
root: 'some/new/path'
});
Default: **.*
The glob
pattern of the files to match.
Default: base64
From the hash.digest([encoding])
man page:
Calculates the digest of all of the passed data to be hashed. The encoding can be
hex
,binary
orbase64
. If no encoding is provided, then a buffer is returned.
Default: md5
From the crypto.createHash(algorithm)
man page:
Creates and returns a hash object, a cryptographic hash with the given algorithm which can be used to generate hash digests.
algorithm
is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples aresha1
,md5
,sha256
,sha512
, etc. On recent releases,openssl list-message-digest-algorithms
will display the available digest algorithms.
Default: production.md5
The filepath to read a saved hash from via this.compare()
, relative to config.root
.
Base path to match config.pattern
.
MIT © Alan Burgoyne