-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#30 fixes for ZIp64 handling (completely overridden _writeCentralDire…
…ctory until fix is introduced to archive)
- Loading branch information
1 parent
7f53e37
commit e833e5d
Showing
3 changed files
with
127 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const archiver = require('archiver'); | ||
const fs = require('fs'); | ||
|
||
const LARGE_FILE = 'C:\\Users\\gooyo\\Downloads\\Blade Runner 2049 (2017) BDRip 720p.mkv'; | ||
|
||
// register format for archiver | ||
archiver.registerFormat( | ||
'zip-encrypted', | ||
require('../') | ||
); | ||
|
||
// create archive and specify method of encryption and password | ||
const archive = archiver.create('zip-encrypted', { | ||
zlib: { level: 4, chunkSize: 10 * 1024 * 1024 }, | ||
encryptionMethod: 'aes256', | ||
password: Buffer.from('123') | ||
}); | ||
|
||
archive.on('error', err => { | ||
console.log(err); | ||
}); | ||
|
||
archive.append(fs.createReadStream(LARGE_FILE), { name: 'data.mkv' }); | ||
// archive.append(fs.createReadStream(LARGE_FILE), { name: 'data.mkv' }); | ||
// archive.append(fs.createReadStream('./issue-30.js'), { name: 'data.txt' }); | ||
archive.finalize(); | ||
|
||
let out = fs.createWriteStream('aes-large-orig.zip'); | ||
archive.pipe(out); |