fixed double declerations

This commit is contained in:
Zhen Yu Yong 2020-06-25 22:11:26 +08:00 committed by Jordan Baczuk
parent 5740ba895a
commit 555fd9b381

View File

@ -78,14 +78,14 @@ function getAes(op) {
} else { } else {
if (op === 'encrypt') { if (op === 'encrypt') {
var cipher = nodeCrypto.createCipheriv('aes-256-cbc', key, iv); var cipher = nodeCrypto.createCipheriv('aes-256-cbc', key, iv);
var firstChunk = cipher.update(data); let firstChunk = cipher.update(data);
var secondChunk = cipher.final(); let secondChunk = cipher.final();
resolve(Buffer.concat([firstChunk, secondChunk])); resolve(Buffer.concat([firstChunk, secondChunk]));
} }
else if (op === 'decrypt') { else if (op === 'decrypt') {
var decipher = nodeCrypto.createDecipheriv('aes-256-cbc', key, iv); var decipher = nodeCrypto.createDecipheriv('aes-256-cbc', key, iv);
var firstChunk = decipher.update(data); let firstChunk = decipher.update(data);
var secondChunk = decipher.final(); let secondChunk = decipher.final();
resolve(Buffer.concat([firstChunk, secondChunk])); resolve(Buffer.concat([firstChunk, secondChunk]));
} }
} }