cyberchef 9.49.0 → 9.49.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyberchef",
3
- "version": "9.49.0",
3
+ "version": "9.49.1",
4
4
  "description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
5
5
  "author": "n1474335 <n1474335@gmail.com>",
6
6
  "homepage": "https://gchq.github.io/CyberChef",
@@ -52,8 +52,12 @@ class PseudoRandomNumberGenerator extends Operation {
52
52
  let bytes;
53
53
 
54
54
  if (isWorkerEnvironment() && self.crypto) {
55
- bytes = self.crypto.getRandomValues(new Uint8Array(numBytes));
56
- bytes = Utils.arrayBufferToStr(bytes.buffer);
55
+ bytes = new ArrayBuffer(numBytes);
56
+ const CHUNK_SIZE = 65536;
57
+ for (let i = 0; i < numBytes; i += CHUNK_SIZE) {
58
+ self.crypto.getRandomValues(new Uint8Array(bytes, i, Math.min(numBytes - i, CHUNK_SIZE)));
59
+ }
60
+ bytes = Utils.arrayBufferToStr(bytes);
57
61
  } else {
58
62
  bytes = forge.random.getBytesSync(numBytes);
59
63
  }