Last chunk decryption.

This commit is contained in:
Pushkar Anand 2021-01-02 17:04:53 +05:30
parent d9b37f93c7
commit 3bc12919be

View file

@ -204,13 +204,21 @@ export const getFile = async (token: string, file: file) => {
tag = newTag;
data = buffer.slice(decryptionChunkSize);
console.log('>', decryptionChunkSize, data.length, tag);
console.log();
} else {
data = buffer;
push();
}
} else {
console.log('end', value.length);
source.endOfStream();
if (data) {
const { decryptedData } = await worker.decryptChunk(data, pullState);
sourceBuffer.appendBuffer(decryptedData);
data = null;
} else {
// console.log('end', value.length);
console.log(source);
// source.endOfStream();
}
}
});
};