mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
swap ENVIRONMENT_IS_* functions for Utils named exports
This commit is contained in:
parent
c70f14419a
commit
1c24c05647
41 changed files with 117 additions and 141 deletions
|
@ -8,6 +8,7 @@ import Operation from "../Operation";
|
|||
import Utils from "../Utils";
|
||||
import { bitOp, xor } from "../lib/BitwiseOp";
|
||||
import { toHex } from "../lib/Hex";
|
||||
import { isWorkerEnvironment } from "../Utils";
|
||||
|
||||
/**
|
||||
* XOR Brute Force operation
|
||||
|
@ -94,7 +95,7 @@ class XORBruteForce extends Operation {
|
|||
|
||||
input = input.slice(sampleOffset, sampleOffset + sampleLength);
|
||||
|
||||
if (ENVIRONMENT_IS_WORKER())
|
||||
if (isWorkerEnvironment())
|
||||
self.sendStatusMessage("Calculating " + Math.pow(256, keyLength) + " values...");
|
||||
|
||||
/**
|
||||
|
@ -114,7 +115,7 @@ class XORBruteForce extends Operation {
|
|||
};
|
||||
|
||||
for (let key = 1, l = Math.pow(256, keyLength); key < l; key++) {
|
||||
if (key % 10000 === 0 && ENVIRONMENT_IS_WORKER()) {
|
||||
if (key % 10000 === 0 && isWorkerEnvironment()) {
|
||||
self.sendStatusMessage("Calculating " + l + " values... " + Math.floor(key / l * 100) + "%");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue