fixed size limit on server to include crypto overhead

This commit is contained in:
Danny Coates 2019-03-06 10:31:50 -08:00
parent dce8b6e525
commit 7f9674f494
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
7 changed files with 24 additions and 11 deletions

View file

@ -281,11 +281,6 @@ class StreamSlicer {
}
}
export function encryptedSize(size, rs = ECE_RECORD_SIZE) {
const chunk_meta = TAG_LENGTH + 1; // Chunk metadata, tag and delimiter
return 21 + size + chunk_meta * Math.ceil(size / (rs - chunk_meta));
}
/*
input: a ReadableStream containing data to be transformed
key: Uint8Array containing key of size KEY_LENGTH