diff options
author | MaleDong <maledong_github@outlook.com> | 2018-09-14 16:13:14 +0800 |
---|---|---|
committer | Tobias Nießen <tniessen@tnie.de> | 2018-09-18 16:06:32 +0200 |
commit | ba0b4e43e442926bfb9389a42aa7393f91e6748a (patch) | |
tree | 44bdbc63fa5ee5501796dace17fc6fd23b484a4a /lib | |
parent | 8989c76c6eff653a3abb19f4cfb3097da58b5dce (diff) | |
download | node-new-ba0b4e43e442926bfb9389a42aa7393f91e6748a.tar.gz |
lib,doc: remove unused parameter, improve docs
1) Remove 'callback' in 'check' function, because we don't check or use
that directly.
2) Make 'digest' clearer in the documentation.
PR-URL: https://github.com/nodejs/node/pull/22858
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/crypto/pbkdf2.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/internal/crypto/pbkdf2.js b/lib/internal/crypto/pbkdf2.js index 140aa2a05a..3567a91e08 100644 --- a/lib/internal/crypto/pbkdf2.js +++ b/lib/internal/crypto/pbkdf2.js @@ -23,7 +23,7 @@ function pbkdf2(password, salt, iterations, keylen, digest, callback) { } ({ password, salt, iterations, keylen, digest } = - check(password, salt, iterations, keylen, digest, callback)); + check(password, salt, iterations, keylen, digest)); if (typeof callback !== 'function') throw new ERR_INVALID_CALLBACK(); @@ -43,7 +43,7 @@ function pbkdf2(password, salt, iterations, keylen, digest, callback) { function pbkdf2Sync(password, salt, iterations, keylen, digest) { ({ password, salt, iterations, keylen, digest } = - check(password, salt, iterations, keylen, digest, pbkdf2Sync)); + check(password, salt, iterations, keylen, digest)); const keybuf = Buffer.alloc(keylen); handleError(keybuf, password, salt, iterations, digest); const encoding = getDefaultEncoding(); @@ -51,7 +51,7 @@ function pbkdf2Sync(password, salt, iterations, keylen, digest) { return keybuf.toString(encoding); } -function check(password, salt, iterations, keylen, digest, callback) { +function check(password, salt, iterations, keylen, digest) { if (typeof digest !== 'string') { if (digest !== null) throw new ERR_INVALID_ARG_TYPE('digest', ['string', 'null'], digest); |