🗑 Remove unneeded code

This commit is contained in:
C-3PO 2018-11-02 00:56:18 +01:00
parent d685e6bfb5
commit 61b3770f24
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -3,12 +3,10 @@ import updateKeys from './lib/updateKeys';
export default function getDecryptor(decryptionKeys: [number, number, number]) {
let [key0, key1, key2] = decryptionKeys;
return (encryptedChunk: Buffer) => {
//const decryptedChunk = Buffer.alloc(encryptedChunk.length);
for (let i = 0; i < encryptedChunk.length; i += 1) {
return (chunk: Buffer) => {
for (let i = 0; i < chunk.length; i += 1) {
//read byte
let curChar = encryptedChunk.readUInt8(i);
let curChar = chunk.readUInt8(i);
//decrypt byte
const keyPart = (key2 | 2) & 0xFFFF;
@ -19,11 +17,9 @@ export default function getDecryptor(decryptionKeys: [number, number, number]) {
[key0, key1, key2] = updateKeys([key0, key1, key2], curChar);
//write byte
//decryptedChunk.writeUInt8(curChar, i);
encryptedChunk.writeUInt8(curChar, i);
chunk.writeUInt8(curChar, i);
}
//return decryptedChunk;
return encryptedChunk;
return chunk;
};
}