aboutsummaryrefslogtreecommitdiff
path: root/node_modules/pbkdf2/lib/sync-browser.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/pbkdf2/lib/sync-browser.js')
-rw-r--r--node_modules/pbkdf2/lib/sync-browser.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/node_modules/pbkdf2/lib/sync-browser.js b/node_modules/pbkdf2/lib/sync-browser.js
index 7f0bf9131..202d29edb 100644
--- a/node_modules/pbkdf2/lib/sync-browser.js
+++ b/node_modules/pbkdf2/lib/sync-browser.js
@@ -63,11 +63,11 @@ function getDigest (alg) {
}
function pbkdf2 (password, salt, iterations, keylen, digest) {
+ checkParameters(password, salt, iterations, keylen)
+
if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding)
if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding)
- checkParameters(iterations, keylen)
-
digest = digest || 'sha1'
var hmac = new Hmac(digest, password, salt.length)