mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -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
|
@ -16,14 +16,14 @@ class Protobuf {
|
|||
/**
|
||||
* Protobuf constructor
|
||||
*
|
||||
* @param {byteArray} data
|
||||
* @param {byteArray|Uint8Array} data
|
||||
*/
|
||||
constructor(data) {
|
||||
// Check we have a byteArray
|
||||
if (data instanceof Array) {
|
||||
// Check we have a byteArray or Uint8Array
|
||||
if (data instanceof Array || data instanceof Uint8Array) {
|
||||
this.data = data;
|
||||
} else {
|
||||
throw new Error("Protobuf input must be a byteArray");
|
||||
throw new Error("Protobuf input must be a byteArray or Uint8Array");
|
||||
}
|
||||
|
||||
// Set up masks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue