diff --git a/package.json b/package.json index 91ed8bbf..a2b4a995 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@filen/sdk", - "version": "0.1.177", + "version": "0.1.178", "description": "Filen SDK", "main": "dist/node/index.js", "browser": "dist/browser/index.js", diff --git a/src/api/client.ts b/src/api/client.ts index 571f0b8d..2e1a7d2f 100644 --- a/src/api/client.ts +++ b/src/api/client.ts @@ -863,12 +863,18 @@ export class APIClient { uploadKey } as unknown as Record).toString() - const bufferHash = await bufferToHash({ buffer, algorithm: "sha512" }) + const bufferHash = await bufferToHash({ + buffer, + algorithm: "sha512" + }) const fullURL = `${ APIClientDefaults.ingestURLs[getRandomArbitrary(0, APIClientDefaults.ingestURLs.length - 1)] }/v3/upload?${urlParams}&hash=${bufferHash}` const parsedURLParams = parseURLParams({ url: fullURL }) - const urlParamsHash = await bufferToHash({ buffer: Buffer.from(JSON.stringify(parsedURLParams), "utf-8"), algorithm: "sha512" }) + const urlParamsHash = await bufferToHash({ + buffer: Buffer.from(JSON.stringify(parsedURLParams), "utf-8"), + algorithm: "sha512" + }) const builtHeaders = this.buildHeaders({ apiKey: undefined }) const response = await this.request({ diff --git a/src/constants.ts b/src/constants.ts index ae6aa9cb..4de8537b 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -13,16 +13,16 @@ export const CHUNK_SIZE = 1024 * 1024 export const BUFFER_SIZE = 4096 export const BASE64_BUFFER_SIZE = 3 * 1024 export const MAX_CONCURRENT_DOWNLOADS = 16 -export const MAX_DOWNLOAD_THREADS = 32 -export const MAX_DOWNLOAD_WRITERS = 64 -export const MAX_UPLOAD_THREADS = 16 +export const MAX_DOWNLOAD_THREADS = 64 +export const MAX_DOWNLOAD_WRITERS = 128 +export const MAX_UPLOAD_THREADS = 32 export const CURRENT_FILE_ENCRYPTION_VERSION = 2 export const DEFAULT_UPLOAD_REGION = "de-1" export const DEFAULT_UPLOAD_BUCKET = "filen-1" export const UPLOAD_CHUNK_SIZE = 1024 * 1024 export const MAX_NOTE_SIZE = 1024 * 1024 - 1 -export const MAX_CONCURRENT_LISTING_OPS = 64 +export const MAX_CONCURRENT_LISTING_OPS = 128 export const MAX_CONCURRENT_UPLOADS = 16 -export const MAX_CONCURRENT_DIRECTORY_UPLOADS = 4 -export const MAX_CONCURRENT_DIRECTORY_DOWNLOADS = 4 +export const MAX_CONCURRENT_DIRECTORY_UPLOADS = 8 +export const MAX_CONCURRENT_DIRECTORY_DOWNLOADS = 8 export const MAX_CHAT_SIZE = 1024 * 64 diff --git a/src/crypto/encrypt.ts b/src/crypto/encrypt.ts index 0c73dc7d..b942cbb1 100644 --- a/src/crypto/encrypt.ts +++ b/src/crypto/encrypt.ts @@ -286,7 +286,12 @@ export class Encrypt { name: "AES-GCM", iv: this.textEncoder.encode(iv) }, - await importRawKey({ key: Buffer.from(key, "utf-8"), algorithm: "AES-GCM", mode: ["encrypt"], keyCache: false }), + await importRawKey({ + key: Buffer.from(key, "utf-8"), + algorithm: "AES-GCM", + mode: ["encrypt"], + keyCache: false + }), data )