mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Updated a range of operations to use ArrayBuffers instead of byteArrays to improve performance with large files.
This commit is contained in:
parent
3a8b362dfd
commit
0e95ad8ed6
37 changed files with 112 additions and 84 deletions
|
@ -23,7 +23,7 @@ class XOR extends Operation {
|
|||
this.module = "Default";
|
||||
this.description = "XOR the input with the given key.<br>e.g. <code>fe023da5</code><br><br><strong>Options</strong><br><u>Null preserving:</u> If the current byte is 0x00 or the same as the key, skip it.<br><br><u>Scheme:</u><ul><li>Standard - key is unchanged after each round</li><li>Input differential - key is set to the value of the previous unprocessed byte</li><li>Output differential - key is set to the value of the previous processed byte</li><li>Cascade - key is set to the input byte shifted by one</li></ul>";
|
||||
this.infoURL = "https://wikipedia.org/wiki/XOR";
|
||||
this.inputType = "byteArray";
|
||||
this.inputType = "ArrayBuffer";
|
||||
this.outputType = "byteArray";
|
||||
this.args = [
|
||||
{
|
||||
|
@ -46,11 +46,12 @@ class XOR extends Operation {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param {byteArray} input
|
||||
* @param {ArrayBuffer} input
|
||||
* @param {Object[]} args
|
||||
* @returns {byteArray}
|
||||
*/
|
||||
run(input, args) {
|
||||
input = new Uint8Array(input);
|
||||
const key = Utils.convertToByteArray(args[0].string || "", args[0].option),
|
||||
[, scheme, nullPreserving] = args;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue