🗑 Remove unneeded code
This commit is contained in:
parent
d685e6bfb5
commit
61b3770f24
1 changed files with 5 additions and 9 deletions
|
@ -3,12 +3,10 @@ import updateKeys from './lib/updateKeys';
|
||||||
export default function getDecryptor(decryptionKeys: [number, number, number]) {
|
export default function getDecryptor(decryptionKeys: [number, number, number]) {
|
||||||
let [key0, key1, key2] = decryptionKeys;
|
let [key0, key1, key2] = decryptionKeys;
|
||||||
|
|
||||||
return (encryptedChunk: Buffer) => {
|
return (chunk: Buffer) => {
|
||||||
//const decryptedChunk = Buffer.alloc(encryptedChunk.length);
|
for (let i = 0; i < chunk.length; i += 1) {
|
||||||
|
|
||||||
for (let i = 0; i < encryptedChunk.length; i += 1) {
|
|
||||||
//read byte
|
//read byte
|
||||||
let curChar = encryptedChunk.readUInt8(i);
|
let curChar = chunk.readUInt8(i);
|
||||||
|
|
||||||
//decrypt byte
|
//decrypt byte
|
||||||
const keyPart = (key2 | 2) & 0xFFFF;
|
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);
|
[key0, key1, key2] = updateKeys([key0, key1, key2], curChar);
|
||||||
|
|
||||||
//write byte
|
//write byte
|
||||||
//decryptedChunk.writeUInt8(curChar, i);
|
chunk.writeUInt8(curChar, i);
|
||||||
encryptedChunk.writeUInt8(curChar, i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//return decryptedChunk;
|
return chunk;
|
||||||
return encryptedChunk;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue