GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — crypto: revise variables for const use instead of let · nodejs/node@faceae4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/crypto
    • scrypt.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/crypto/scrypt.js‎

Copy file name to clipboardExpand all lines: lib/internal/crypto/scrypt.js
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ function check(password, salt, keylen, options) {
9898

9999
let { N, r, p, maxmem } = defaults;
100100
if (options && options !== defaults) {
101-
let has_N, has_r, has_p;
102-
if (has_N = (options.N !== undefined)) {
101+
const has_N = options.N !== undefined;
102+
if (has_N) {
103103
N = options.N;
104104
validateUint32(N, 'N');
105105
}
@@ -108,7 +108,8 @@ function check(password, salt, keylen, options) {
108108
N = options.cost;
109109
validateUint32(N, 'cost');
110110
}
111-
if (has_r = (options.r !== undefined)) {
111+
const has_r = (options.r !== undefined);
112+
if (has_r) {
112113
r = options.r;
113114
validateUint32(r, 'r');
114115
}
@@ -117,7 +118,8 @@ function check(password, salt, keylen, options) {
117118
r = options.blockSize;
118119
validateUint32(r, 'blockSize');
119120
}
120-
if (has_p = (options.p !== undefined)) {
121+
const has_p = options.p !== undefined;
122+
if (has_p) {
121123
p = options.p;
122124
validateUint32(p, 'p');
123125
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.