From 7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 28 May 2017 00:38:50 +0200 Subject: add linting (and some initial fixes) --- node_modules/md5-hex/index.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 node_modules/md5-hex/index.js (limited to 'node_modules/md5-hex/index.js') diff --git a/node_modules/md5-hex/index.js b/node_modules/md5-hex/index.js new file mode 100644 index 000000000..c52bddd7c --- /dev/null +++ b/node_modules/md5-hex/index.js @@ -0,0 +1,23 @@ +'use strict'; +var crypto = require('crypto'); + +module.exports = function (input) { + var hash = crypto.createHash('md5'); + + var update = function (buf) { + var inputEncoding = typeof buf === 'string' ? 'utf8' : undefined; + hash.update(buf, inputEncoding); + }; + + if (arguments.length > 1) { + throw new Error('Too many arguments. Try specifying an array.'); + } + + if (Array.isArray(input)) { + input.forEach(update); + } else { + update(input); + } + + return hash.digest('hex'); +}; -- cgit v1.2.3