utils.js
function digestFile(file, algorithm, encoding) {
    return crypto.createHash(algorithm || 'md5').update(fs.readFileSync(file)).digest(encoding || 'hex');
}
function digestFile(file, algorithm, encoding) {
    return crypto.createHash(algorithm || 'md5').update(fs.readFileSync(file)).digest(encoding || 'hex');
}
function digestFile ( file , algorithm , encoding ) { return crypto . createHash ( algorithm || 'md5' ) . update ( fs . readFileSync ( file ) ) . digest ( encoding || 'hex' ) ; }
digest file content.

@param {String} file
@param {String} [algorithm='md5']  'sha1', 'md5', 'sha256', 'sha512'...
@param {String} [encoding='hex'] 'hex', 'binary' or 'base64'
@return {String} digest string
digest file content .