Updated a range of operations to use ArrayBuffers instead of byteArrays to improve performance with large files.

This commit is contained in:
n1474335 2019-07-29 17:09:46 +01:00
parent 3a8b362dfd
commit 0e95ad8ed6
37 changed files with 112 additions and 84 deletions

View file

@ -23,7 +23,7 @@ class OR extends Operation {
this.module = "Default";
this.description = "OR the input with the given key.<br>e.g. <code>fe023da5</code>";
this.infoURL = "https://wikipedia.org/wiki/Bitwise_operation#OR";
this.inputType = "byteArray";
this.inputType = "ArrayBuffer";
this.outputType = "byteArray";
this.args = [
{
@ -36,12 +36,13 @@ class OR extends Operation {
}
/**
* @param {byteArray} input
* @param {ArrayBuffer} input
* @param {Object[]} args
* @returns {byteArray}
*/
run(input, args) {
const key = Utils.convertToByteArray(args[0].string || "", args[0].option);
input = new Uint8Array(input);
return bitOp(input, key, or);
}