mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 00:06:17 -04:00
Gzip tests added
This commit is contained in:
parent
3a1a6a94d2
commit
5fd2512a9b
3 changed files with 91 additions and 2 deletions
|
@ -6,7 +6,6 @@
|
|||
|
||||
import Operation from "../Operation.mjs";
|
||||
import {COMPRESSION_TYPE, ZLIB_COMPRESSION_TYPE_LOOKUP} from "../lib/Zlib.mjs";
|
||||
// import zlibAndGzip from "zlibjs/bin/zlib_and_gzip.min.js";
|
||||
import gzip from "zlibjs/bin/gzip.min.js";
|
||||
|
||||
const Zlib = gzip.Zlib;
|
||||
|
@ -79,7 +78,7 @@ class Gzip extends Operation {
|
|||
}
|
||||
const gzipObj = new Zlib.Gzip(new Uint8Array(input), options);
|
||||
const compressed = new Uint8Array(gzipObj.compress());
|
||||
if (options.flags.comment) {
|
||||
if (options.flags.comment && !(compressed[3] & 0x10)) {
|
||||
compressed[3] |= 0x10;
|
||||
}
|
||||
return compressed.buffer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue