From cc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 27 Mar 2019 21:01:33 +0100 Subject: remove node_modules --- node_modules/pbkdf2/lib/precondition.js | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 node_modules/pbkdf2/lib/precondition.js (limited to 'node_modules/pbkdf2/lib/precondition.js') diff --git a/node_modules/pbkdf2/lib/precondition.js b/node_modules/pbkdf2/lib/precondition.js deleted file mode 100644 index 683db5630..000000000 --- a/node_modules/pbkdf2/lib/precondition.js +++ /dev/null @@ -1,28 +0,0 @@ -var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs - -function checkBuffer (buf, name) { - if (typeof buf !== 'string' && !Buffer.isBuffer(buf)) { - throw new TypeError(name + ' must be a buffer or string') - } -} - -module.exports = function (password, salt, iterations, keylen) { - checkBuffer(password, 'Password') - checkBuffer(salt, 'Salt') - - if (typeof iterations !== 'number') { - throw new TypeError('Iterations not a number') - } - - if (iterations < 0) { - throw new TypeError('Bad iterations') - } - - if (typeof keylen !== 'number') { - throw new TypeError('Key length not a number') - } - - if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */ - throw new TypeError('Bad key length') - } -} -- cgit v1.2.3