Skip to content

Commit f915f41

Browse files
lint fix
1 parent 9633b42 commit f915f41

22 files changed

+170
-170
lines changed

src/algo/hash/md5.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {WordArray,} from '../../core/core.js';
2-
import {Hasher,} from '../../core/hasher';
3-
import {loadWasm,} from '../../utils/wasm-utils';
4-
import {wasmBytes,} from './md5_wasm';
5-
import {md5Wasm,} from './md5_bg';
1+
import {WordArray} from '../../core/core.js';
2+
import {Hasher} from '../../core/hasher';
3+
import {loadWasm} from '../../utils/wasm-utils';
4+
import {wasmBytes} from './md5_wasm';
5+
import {md5Wasm} from './md5_bg';
66

77
/**
88
* MD5 hash algorithm.
@@ -29,7 +29,7 @@ export class MD5Algo extends Hasher {
2929
0x67452301,
3030
0xefcdab89,
3131
0x98badcfe,
32-
0x10325476,
32+
0x10325476
3333
]);
3434
}
3535

src/algo/hash/ripemd160.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
2020
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2121
*/
2222

23-
import { Hasher, } from '../../core/hasher';
24-
import {WordArray,} from '../../core/core.js';
25-
import {ripemd160Wasm,} from './ripemd160_bg';
26-
import {wasmBytes,} from './ripemd160_wasm';
27-
import {loadWasm,} from '../../utils/wasm-utils';
23+
import { Hasher } from '../../core/hasher';
24+
import {WordArray} from '../../core/core.js';
25+
import {ripemd160Wasm} from './ripemd160_bg';
26+
import {wasmBytes} from './ripemd160_wasm';
27+
import {loadWasm} from '../../utils/wasm-utils';
2828

2929

3030

@@ -49,7 +49,7 @@ export class RIPEMD160Algo extends Hasher {
4949
}
5050

5151
_doReset() {
52-
this._hash = new WordArray([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0,]);
52+
this._hash = new WordArray([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);
5353
}
5454

5555
_process(doFlush) {

src/algo/hash/sha1.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {WordArray,} from '../../core/core';
2-
import {Hasher,} from '../../core/hasher';
3-
import {wasmBytes,} from './sha1_wasm';
4-
import {loadWasm,} from '../../utils/wasm-utils';
5-
import {sha1Wasm,} from './sha1_bg';
1+
import {WordArray} from '../../core/core';
2+
import {Hasher} from '../../core/hasher';
3+
import {wasmBytes} from './sha1_wasm';
4+
import {loadWasm} from '../../utils/wasm-utils';
5+
import {sha1Wasm} from './sha1_bg';
66

77
/**
88
* SHA-1 hash algorithm.
@@ -30,7 +30,7 @@ export class SHA1Algo extends Hasher {
3030
0xefcdab89,
3131
0x98badcfe,
3232
0x10325476,
33-
0xc3d2e1f0,
33+
0xc3d2e1f0
3434
]);
3535
}
3636

src/algo/hash/sha224.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { WordArray, } from '../../core/core.js';
2-
import { SHA256Algo, } from './sha256.js';
1+
import { WordArray } from '../../core/core.js';
2+
import { SHA256Algo } from './sha256.js';
33

44
/**
55
* SHA-224 hash algorithm.
@@ -24,7 +24,7 @@ export class SHA224Algo extends SHA256Algo {
2424
0xffc00b31,
2525
0x68581511,
2626
0x64f98fa7,
27-
0xbefa4fa4,
27+
0xbefa4fa4
2828
]);
2929
}
3030

src/algo/hash/sha256.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import {WordArray,} from '../../core/core.js';
2-
import {Hasher,} from '../../core/hasher';
3-
import {loadWasm,} from '../../utils/wasm-utils';
4-
import {wasmBytes,} from './sha256_wasm';
5-
import {sha256Wasm,} from './sha256_bg';
1+
import {WordArray} from '../../core/core.js';
2+
import {Hasher} from '../../core/hasher';
3+
import {loadWasm} from '../../utils/wasm-utils';
4+
import {wasmBytes} from './sha256_wasm';
5+
import {sha256Wasm} from './sha256_bg';
66

77
// Initialization and round constants tables
8-
const H = [1779033703, -1150833019, 1013904242, -1521486534, 1359893119, -1694144372, 528734635, 1541459225,];
8+
const H = [1779033703, -1150833019, 1013904242, -1521486534, 1359893119, -1694144372, 528734635, 1541459225];
99

1010
/**
1111
* SHA-256 hash algorithm.

src/algo/hash/sha384.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {X64Word, X64WordArray,} from '../../core/x64-core.js';
2-
import {SHA512Algo,} from './sha512.js';
1+
import {X64Word, X64WordArray} from '../../core/x64-core.js';
2+
import {SHA512Algo} from './sha512.js';
33

44
/**
55
* SHA-384 hash algorithm.
@@ -24,7 +24,7 @@ export class SHA384Algo extends SHA512Algo {
2424
new X64Word(0x67332667, 0xffc00b31),
2525
new X64Word(0x8eb44a87, 0x68581511),
2626
new X64Word(0xdb0c2e0d, 0x64f98fa7),
27-
new X64Word(0x47b5481d, 0xbefa4fa4),
27+
new X64Word(0x47b5481d, 0xbefa4fa4)
2828
]);
2929
}
3030

src/algo/hash/sha512.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import {Hasher,} from '../../core/hasher';
2-
import {WordArray,} from '../../core/core.js';
3-
import {X64Word, X64WordArray,} from '../../core/x64-core.js';
4-
import {loadWasm,} from '../../utils/wasm-utils';
5-
import {wasmBytes,} from './sha512_wasm';
6-
import {sha512Wasm,} from './sha512_bg';
1+
import {Hasher} from '../../core/hasher';
2+
import {WordArray} from '../../core/core.js';
3+
import {X64Word, X64WordArray} from '../../core/x64-core.js';
4+
import {loadWasm} from '../../utils/wasm-utils';
5+
import {wasmBytes} from './sha512_wasm';
6+
import {sha512Wasm} from './sha512_bg';
77

88
/**
99
* SHA-512 hash algorithm.
@@ -40,7 +40,7 @@ export class SHA512Algo extends Hasher {
4040
new X64Word(0x510e527f, 0xade682d1),
4141
new X64Word(0x9b05688c, 0x2b3e6c1f),
4242
new X64Word(0x1f83d9ab, 0xfb41bd6b),
43-
new X64Word(0x5be0cd19, 0x137e2179),
43+
new X64Word(0x5be0cd19, 0x137e2179)
4444
]);
4545
}
4646

src/core/cipher-core.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
import {
44
Base,
55
WordArray,
6-
BufferedBlockAlgorithm,
6+
BufferedBlockAlgorithm
77
} from '../core/core.js';
88
import {
9-
Base64,
9+
Base64
1010
} from '../encoding/enc-base64.js';
1111
import {
12-
EvpKDFAlgo,
12+
EvpKDFAlgo
1313
} from '../encryption/evpkdf.js';
14-
import { isString, } from '../utils';
15-
import { Pkcs7, } from '../pad/pad-pkcs7';
16-
import {MD5Algo,} from '../algo/hash/md5';
14+
import { isString } from '../utils';
15+
import { Pkcs7 } from '../pad/pad-pkcs7';
16+
import {MD5Algo} from '../algo/hash/md5';
1717

1818

1919
/**
@@ -152,7 +152,7 @@ export class Cipher extends BufferedBlockAlgorithm {
152152

153153
decrypt(ciphertext, key, cfg) {
154154
return selectCipherStrategy(key).decrypt(SubCipher, ciphertext, key, cfg);
155-
},
155+
}
156156
};
157157
}
158158

@@ -345,7 +345,7 @@ CBC.Encryptor = class extends CBC {
345345
// Shortcuts
346346
const cipher = this._cipher;
347347
const {
348-
blockSize,
348+
blockSize
349349
} = cipher;
350350

351351
// XOR and encrypt
@@ -374,7 +374,7 @@ CBC.Decryptor = class extends CBC {
374374
// Shortcuts
375375
const cipher = this._cipher;
376376
const {
377-
blockSize,
377+
blockSize
378378
} = cipher;
379379

380380
// Remember this block to use with next block
@@ -406,7 +406,7 @@ export class BlockCipher extends Cipher {
406406
*/
407407
super(xformMode, key, Object.assign({
408408
mode: CBC,
409-
padding: Pkcs7,
409+
padding: Pkcs7
410410
},
411411
cfg,
412412
));
@@ -422,11 +422,11 @@ export class BlockCipher extends Cipher {
422422

423423
// Shortcuts
424424
const {
425-
cfg,
425+
cfg
426426
} = this;
427427
const {
428428
iv,
429-
mode,
429+
mode
430430
} = cfg;
431431

432432
// Reset block mode
@@ -452,7 +452,7 @@ export class BlockCipher extends Cipher {
452452

453453
// Shortcut
454454
const {
455-
padding,
455+
padding
456456
} = this.cfg;
457457

458458
// Finalize
@@ -557,12 +557,12 @@ export const OpenSSLFormatter = {
557557
// Shortcuts
558558
const {
559559
ciphertext,
560-
salt,
560+
salt
561561
} = cipherParams;
562562

563563
// Format
564564
if (salt) {
565-
wordArray = new WordArray([0x53616c74, 0x65645f5f,]).concat(salt).concat(ciphertext);
565+
wordArray = new WordArray([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
566566
} else {
567567
wordArray = ciphertext;
568568
}
@@ -604,9 +604,9 @@ export const OpenSSLFormatter = {
604604

605605
return new CipherParams({
606606
ciphertext,
607-
salt,
607+
salt
608608
});
609-
},
609+
}
610610
};
611611

612612
/**
@@ -655,7 +655,7 @@ export class SerializableCipher extends Base {
655655
mode: cipherCfg.mode,
656656
padding: cipherCfg.padding,
657657
blockSize: encryptor.blockSize,
658-
formatter: _cfg.format,
658+
formatter: _cfg.format
659659
});
660660
}
661661

@@ -728,7 +728,7 @@ export class SerializableCipher extends Base {
728728
*/
729729
SerializableCipher.cfg = Object.assign(
730730
new Base(), {
731-
format: OpenSSLFormatter,
731+
format: OpenSSLFormatter
732732
},
733733
);
734734

@@ -770,9 +770,9 @@ export const OpenSSLKdf = {
770770
// Derive key and IV
771771
let key;
772772
if (!hasher) {
773-
key = new EvpKDFAlgo({keySize: keySize + ivSize,}).compute(password, _salt);
773+
key = new EvpKDFAlgo({keySize: keySize + ivSize}).compute(password, _salt);
774774
} else {
775-
key = new EvpKDFAlgo({keySize: keySize + ivSize, hasher: hasher,}).compute(password, salt);
775+
key = new EvpKDFAlgo({keySize: keySize + ivSize, hasher: hasher}).compute(password, salt);
776776
}
777777

778778
// Separate key and IV
@@ -783,9 +783,9 @@ export const OpenSSLKdf = {
783783
return new CipherParams({
784784
key,
785785
iv,
786-
salt: _salt,
786+
salt: _salt
787787
});
788-
},
788+
}
789789
};
790790

791791
/**
@@ -893,5 +893,5 @@ export class PasswordBasedCipher extends SerializableCipher {
893893
* Default: OpenSSL
894894
*/
895895
PasswordBasedCipher.cfg = Object.assign(SerializableCipher.cfg, {
896-
kdf: OpenSSLKdf,
896+
kdf: OpenSSLKdf
897897
});

src/core/core.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
/**
44
* Base class for inheritance.
55
*/
6-
import { Utf8, } from '../encoding/enc-utf8';
7-
import { Hex, } from '../encoding/enc-hax';
8-
import { isString, } from '../utils';
6+
import { Utf8 } from '../encoding/enc-utf8';
7+
import { Hex } from '../encoding/enc-hax';
8+
import { isString } from '../utils';
99

1010
let crypto;
1111
// Native crypto from window (Browser)
@@ -263,7 +263,7 @@ export class WordArray extends Base {
263263
// Shortcuts
264264
const {
265265
words,
266-
sigBytes,
266+
sigBytes
267267
} = this;
268268

269269
// Clamp
@@ -362,7 +362,7 @@ export class BufferedBlockAlgorithm extends Base {
362362
// Shortcuts
363363
const {
364364
_data: data,
365-
blockSize,
365+
blockSize
366366
} = this;
367367
const dataWords = data.words;
368368
const dataSigBytes = data.sigBytes;

src/core/hasher.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {BufferedBlockAlgorithm, Base,} from './core';
2-
import {HMAC,} from '../algo/hmac/hmac';
1+
import {BufferedBlockAlgorithm, Base} from './core';
2+
import {HMAC} from '../algo/hmac/hmac';
33

44

55
/**

0 commit comments

Comments
 (0)