@gethashd/bytecave-browser 1.0.42 → 1.0.43
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.
|
@@ -6143,7 +6143,13 @@ var StorageWebSocketClient = class {
|
|
|
6143
6143
|
await this.connect();
|
|
6144
6144
|
}
|
|
6145
6145
|
const requestId = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
|
|
6146
|
-
const
|
|
6146
|
+
const chunkSize = 8192;
|
|
6147
|
+
let binaryString = "";
|
|
6148
|
+
for (let i = 0; i < options.data.length; i += chunkSize) {
|
|
6149
|
+
const chunk = options.data.subarray(i, i + chunkSize);
|
|
6150
|
+
binaryString += String.fromCharCode(...chunk);
|
|
6151
|
+
}
|
|
6152
|
+
const base64Data = btoa(binaryString);
|
|
6147
6153
|
const request = {
|
|
6148
6154
|
type: "storage-request",
|
|
6149
6155
|
requestId,
|
package/dist/index.cjs
CHANGED
|
@@ -6196,7 +6196,13 @@ var StorageWebSocketClient = class {
|
|
|
6196
6196
|
await this.connect();
|
|
6197
6197
|
}
|
|
6198
6198
|
const requestId = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
|
|
6199
|
-
const
|
|
6199
|
+
const chunkSize = 8192;
|
|
6200
|
+
let binaryString = "";
|
|
6201
|
+
for (let i = 0; i < options.data.length; i += chunkSize) {
|
|
6202
|
+
const chunk = options.data.subarray(i, i + chunkSize);
|
|
6203
|
+
binaryString += String.fromCharCode(...chunk);
|
|
6204
|
+
}
|
|
6205
|
+
const base64Data = btoa(binaryString);
|
|
6200
6206
|
const request = {
|
|
6201
6207
|
type: "storage-request",
|
|
6202
6208
|
requestId,
|
package/dist/index.js
CHANGED
package/dist/react/index.js
CHANGED
package/package.json
CHANGED
package/src/storage-websocket.ts
CHANGED
|
@@ -152,7 +152,14 @@ export class StorageWebSocketClient {
|
|
|
152
152
|
Math.random().toString(36).substring(2, 15);
|
|
153
153
|
|
|
154
154
|
// Convert Uint8Array to base64
|
|
155
|
-
|
|
155
|
+
// Chunk the data to avoid stack overflow with large files
|
|
156
|
+
const chunkSize = 8192;
|
|
157
|
+
let binaryString = '';
|
|
158
|
+
for (let i = 0; i < options.data.length; i += chunkSize) {
|
|
159
|
+
const chunk = options.data.subarray(i, i + chunkSize);
|
|
160
|
+
binaryString += String.fromCharCode(...chunk);
|
|
161
|
+
}
|
|
162
|
+
const base64Data = btoa(binaryString);
|
|
156
163
|
|
|
157
164
|
const request: StorageRequestMessage = {
|
|
158
165
|
type: 'storage-request',
|