From 555fd9b381a78bad59b28bc6002528c26cda5dea Mon Sep 17 00:00:00 2001 From: Zhen Yu Yong Date: Thu, 25 Jun 2020 22:11:26 +0800 Subject: [PATCH] fixed double declerations --- browser.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/browser.js b/browser.js index b5bae33..c9847df 100644 --- a/browser.js +++ b/browser.js @@ -78,14 +78,14 @@ function getAes(op) { } else { if (op === 'encrypt') { var cipher = nodeCrypto.createCipheriv('aes-256-cbc', key, iv); - var firstChunk = cipher.update(data); - var secondChunk = cipher.final(); + let firstChunk = cipher.update(data); + let secondChunk = cipher.final(); resolve(Buffer.concat([firstChunk, secondChunk])); } else if (op === 'decrypt') { var decipher = nodeCrypto.createDecipheriv('aes-256-cbc', key, iv); - var firstChunk = decipher.update(data); - var secondChunk = decipher.final(); + let firstChunk = decipher.update(data); + let secondChunk = decipher.final(); resolve(Buffer.concat([firstChunk, secondChunk])); } }