🚑 Fix chunk decryption

This commit is contained in:
C-3PO 2018-07-05 02:35:37 +02:00
parent 4f0adf8931
commit 1d1b8930cf
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -6,7 +6,7 @@ export default function decryptChunk(encryptedChunk: Buffer, [key0, key1, key2]:
const decryptedChunk = new Buffer(encryptedChunk.length); const decryptedChunk = new Buffer(encryptedChunk.length);
const dvOut = new DataView(decryptedChunk.buffer); const dvOut = new DataView(decryptedChunk.buffer);
for (let i = 0; i < length; i += 1) { for (let i = 0; i < encryptedChunk.length; i += 1) {
//read and decrypt byte //read and decrypt byte
let curChar = dv.getUint8(i); let curChar = dv.getUint8(i);
const keyPart = (key2 | 2) & 0xFFFF; const keyPart = (key2 | 2) & 0xFFFF;