MCPcopy Create free account
hub / github.com/Criptext/Criptext-Email-React-Client / zipStreamFile

Function zipStreamFile

electron_app/src/backup/Compress.js:9–20  ·  view source on GitHub ↗
({ inputFile, outputFile })

Source from the content-addressed store, hash-verified

7const DEFAULT_KEY_LENGTH = 16;
8
9const zipStreamFile = ({ inputFile, outputFile }) => {
10 return new Promise((resolve, reject) => {
11 const highWaterMark = STREAM_SIZE;
12 const reader = fs.createReadStream(inputFile, { highWaterMark });
13 const writer = fs.createWriteStream(outputFile);
14 reader
15 .pipe(zlib.createGzip())
16 .pipe(writer)
17 .on('error', reject)
18 .on('finish', resolve);
19 });
20};
21
22const encryptStreamFile = ({ inputFile, outputFile, key, iv, salt }) => {
23 return new Promise((resolve, reject) => {

Callers 1

startFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected