diff --git a/lib/internal/crypto/scrypt.js b/lib/internal/crypto/scrypt.js index 63a5547e4cbf79..49e5b0624e1ae7 100644 --- a/lib/internal/crypto/scrypt.js +++ b/lib/internal/crypto/scrypt.js @@ -98,8 +98,8 @@ function check(password, salt, keylen, options) { let { N, r, p, maxmem } = defaults; if (options && options !== defaults) { - let has_N, has_r, has_p; - if (has_N = (options.N !== undefined)) { + const has_N = options.N !== undefined; + if (has_N) { N = options.N; validateUint32(N, 'N'); } @@ -108,7 +108,8 @@ function check(password, salt, keylen, options) { N = options.cost; validateUint32(N, 'cost'); } - if (has_r = (options.r !== undefined)) { + const has_r = (options.r !== undefined); + if (has_r) { r = options.r; validateUint32(r, 'r'); } @@ -117,7 +118,8 @@ function check(password, salt, keylen, options) { r = options.blockSize; validateUint32(r, 'blockSize'); } - if (has_p = (options.p !== undefined)) { + const has_p = options.p !== undefined; + if (has_p) { p = options.p; validateUint32(p, 'p'); }