mirror of
https://github.com/gchq/CyberChef
synced 2025-01-24 02:05:02 +00:00
Use all the arraybuffers
cuts a solid 1/3 off the compression time
This commit is contained in:
parent
c5698fcd65
commit
8445165491
1 changed files with 3 additions and 7 deletions
|
@ -24,7 +24,7 @@ class Bzip2Compress extends Operation {
|
|||
this.description = "Bzip2 is a compression library developed by Julian Seward (of GHC fame) that uses the Burrows-Wheeler algorithm. It only supports compressing single files and its compression is slow, however is more effective than Deflate (.gz & .zip).";
|
||||
this.infoURL = "https://wikipedia.org/wiki/Bzip2";
|
||||
this.inputType = "ArrayBuffer";
|
||||
this.outputType = "File";
|
||||
this.outputType = "ArrayBuffer";
|
||||
this.args = [
|
||||
{
|
||||
name: "Block size (100s of kb)",
|
||||
|
@ -35,11 +35,6 @@ class Bzip2Compress extends Operation {
|
|||
name: "Work factor",
|
||||
type: "number",
|
||||
value: 30
|
||||
},
|
||||
{
|
||||
name: "Compressed filename",
|
||||
type: "string",
|
||||
value: "compressed.bz2"
|
||||
}
|
||||
];
|
||||
}
|
||||
|
@ -63,7 +58,8 @@ class Bzip2Compress extends Operation {
|
|||
if (bzip2cc.error !== 0) {
|
||||
reject(new OperationError(bzip2cc.error_msg));
|
||||
} else {
|
||||
resolve(new File([bzip2cc.output], filename));
|
||||
const output = bzip2cc.output;
|
||||
resolve(output.buffer.slice(output.byteOffset, output.byteLength + output.byteOffset));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue