mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 15:26:16 -04:00
Operations can now set options from within the worker
This commit is contained in:
parent
13f07abb8a
commit
f6b52b7c82
10 changed files with 81 additions and 38 deletions
|
@ -137,7 +137,8 @@ const BitwiseOp = {
|
|||
|
||||
input = input.slice(sampleOffset, sampleOffset + sampleLength);
|
||||
|
||||
if (self) self.sendStatusMessage("Calculating " + Math.pow(256, keyLength) + " values...");
|
||||
if (ENVIRONMENT_IS_WORKER())
|
||||
self.sendStatusMessage("Calculating " + Math.pow(256, keyLength) + " values...");
|
||||
|
||||
/**
|
||||
* Converts an integer to an array of bytes expressing that number.
|
||||
|
@ -156,7 +157,7 @@ const BitwiseOp = {
|
|||
};
|
||||
|
||||
for (let key = 1, l = Math.pow(256, keyLength); key < l; key++) {
|
||||
if (key % 10000 === 0 && self) {
|
||||
if (key % 10000 === 0 && ENVIRONMENT_IS_WORKER()) {
|
||||
self.sendStatusMessage("Calculating " + l + " values... " + Math.floor(key / l * 100) + "%");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue