Skip to content

Commit b4ec7d6

Browse files
ghvaldezaddaleax
authored andcommitted
test: use const in test-crypto-pbkdf2
Updated all remaining var to const PR-URL: #9974 Reviewed-By: Rich Trott <[email protected]>
1 parent 2e889cf commit b4ec7d6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/parallel/test-crypto-pbkdf2.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
2+
const common = require('../common');
3+
const assert = require('assert');
44

55
if (!common.hasCrypto) {
66
common.skip('missing crypto');
77
return;
88
}
9-
var crypto = require('crypto');
9+
const crypto = require('crypto');
1010

1111
//
1212
// Test PBKDF2 with RFC 6070 test vectors (except #4)
1313
//
1414
function testPBKDF2(password, salt, iterations, keylen, expected) {
15-
var actual = crypto.pbkdf2Sync(password, salt, iterations, keylen, 'sha256');
15+
const actual =
16+
crypto.pbkdf2Sync(password, salt, iterations, keylen, 'sha256');
1617
assert.strictEqual(actual.toString('latin1'), expected);
1718

1819
crypto.pbkdf2(password, salt, iterations, keylen, 'sha256', (err, actual) => {
@@ -44,9 +45,9 @@ testPBKDF2('pass\0word', 'sa\0lt', 4096, 16,
4445
'\x89\xb6\x9d\x05\x16\xf8\x29\x89\x3c\x69\x62\x26\x65' +
4546
'\x0a\x86\x87');
4647

47-
var expected =
48+
const expected =
4849
'64c486c55d30d4c5a079b8823b7d7cb37ff0556f537da8410233bcec330ed956';
49-
var key = crypto.pbkdf2Sync('password', 'salt', 32, 32, 'sha256');
50+
const key = crypto.pbkdf2Sync('password', 'salt', 32, 32, 'sha256');
5051
assert.strictEqual(key.toString('hex'), expected);
5152

5253
crypto.pbkdf2('password', 'salt', 32, 32, 'sha256', common.mustCall(ondone));

0 commit comments

Comments
 (0)