mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Added File and JSON Dish types and updated types for compression ops.
This commit is contained in:
parent
76a066ab74
commit
a8aa1bc5e8
9 changed files with 94 additions and 59 deletions
|
@ -24,8 +24,8 @@ class Gzip extends Operation {
|
|||
this.name = "Gzip";
|
||||
this.module = "Compression";
|
||||
this.description = "Compresses data using the deflate algorithm with gzip headers.";
|
||||
this.inputType = "byteArray";
|
||||
this.outputType = "byteArray";
|
||||
this.inputType = "ArrayBuffer";
|
||||
this.outputType = "ArrayBuffer";
|
||||
this.args = [
|
||||
{
|
||||
name: "Compression type",
|
||||
|
@ -51,9 +51,9 @@ class Gzip extends Operation {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param {byteArray} input
|
||||
* @param {ArrayBuffer} input
|
||||
* @param {Object[]} args
|
||||
* @returns {byteArray}
|
||||
* @returns {ArrayBuffer}
|
||||
*/
|
||||
run(input, args) {
|
||||
const filename = args[1],
|
||||
|
@ -76,8 +76,8 @@ class Gzip extends Operation {
|
|||
options.comment = comment;
|
||||
}
|
||||
|
||||
const gzip = new Zlib.Gzip(input, options);
|
||||
return Array.prototype.slice.call(gzip.compress());
|
||||
const gzip = new Zlib.Gzip(new Uint8Array(input), options);
|
||||
return new Uint8Array(gzip.compress()).buffer;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue