mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 07:16:17 -04:00
update more ENVIRONMENT_IS_* calls after merge, update some test paths, comments. Remove vulnerability
This commit is contained in:
parent
368f508b17
commit
e03ff22ba8
10 changed files with 31 additions and 19 deletions
|
@ -7,6 +7,7 @@
|
|||
import Operation from "../Operation";
|
||||
import OperationError from "../errors/OperationError";
|
||||
import Bzip2 from "libbzip2-wasm";
|
||||
import { isWorkerEnvironment } from "../Utils";
|
||||
|
||||
/**
|
||||
* Bzip2 Compress operation
|
||||
|
@ -51,10 +52,10 @@ class Bzip2Compress extends Operation {
|
|||
if (input.byteLength <= 0) {
|
||||
throw new OperationError("Please provide an input.");
|
||||
}
|
||||
if (ENVIRONMENT_IS_WORKER()) self.sendStatusMessage("Loading Bzip2...");
|
||||
if (isWorkerEnvironment()) self.sendStatusMessage("Loading Bzip2...");
|
||||
return new Promise((resolve, reject) => {
|
||||
Bzip2().then(bzip2 => {
|
||||
if (ENVIRONMENT_IS_WORKER()) self.sendStatusMessage("Compressing data...");
|
||||
if (isWorkerEnvironment()) self.sendStatusMessage("Compressing data...");
|
||||
const inpArray = new Uint8Array(input);
|
||||
const bzip2cc = bzip2.compressBZ2(inpArray, blockSize, workFactor);
|
||||
if (bzip2cc.error !== 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue