Zip.js - A JavaScript library to zip and unzip files
11–20 of 25 posts
Re: Zip.js - A JavaScript library to zip and unzip files
#12https://mail.mozilla.org/pipermail/es-discuss/2012-January/0...
Re: Zip.js - A JavaScript library to zip and unzip files
#13I am the author of the library. Just to be clear about my motivations, I wrote this library for chrome extensions. It's a simple way to export/import large user data.
Can you tell us why you don't rely on built-in compression? I would guess both local storage and HTTP POST automatically compress files... is this not the case?
Re: Zip.js - A JavaScript library to zip and unzip files
#14Also check out: http://jszip.stuartk.co.uk/ I used it a week ago for a simple project (a kinda secure file system - with PHP and MongoDB for backend). I would encrypt a file on my server (AES) and then send the encrypted data to user's browser. Then I could decrypt the data with JavaScript and used JSZip to make user's browser download the decrypted files.
Re: Zip.js - A JavaScript library to zip and unzip files
#15Also check out: http://jszip.stuartk.co.uk/ I used it a week ago for a simple project (a kinda secure file system - with PHP and MongoDB for backend). I would encrypt a file on my server (AES) and then send the encrypted data to user's browser. Then I could decrypt the data with JavaScript and used JSZip to make user's browser download the decrypted files.
Re: Zip.js - A JavaScript library to zip and unzip files
#16Pretty cool, but the thought of inflate/deflate running in Javascript makes me cringe. How fast is this?
I just tested with a 42 MB text log file under OS X 10.7.2. Using zip 3.0: $ time zip logfile.zip logfile.log adding: logfile.log (deflated 89%) real 0m1.170s user 0m0.947s sys 0m0.030s Resulting file size: 4,551,020 bytes Using Chrome 16.0.912.77: 4.7s - 1st drop 5.5s - 2nd drop 5.2s - 3rd drop 5.1s - 4th drop Average 5.125s (timed using stopwatch) Resulting file size: 4,547,885 bytes Size: Advantage Zip.js by 3,135…
Your calculation of 6.8% better than zip just seemed too impressive.
Re: Zip.js - A JavaScript library to zip and unzip files
#17any idea what would be involved in getting this working in IE?
Re: Zip.js - A JavaScript library to zip and unzip files
#18Re: Zip.js - A JavaScript library to zip and unzip files
#19Also check out: http://jszip.stuartk.co.uk/ I used it a week ago for a simple project (a kinda secure file system - with PHP and MongoDB for backend). I would encrypt a file on my server (AES) and then send the encrypted data to user's browser. Then I could decrypt the data with JavaScript and used JSZip to make user's browser download the decrypted files.
Why go to all the hassle of encrypting/decrypting and not just use HTTPS?
Re: Zip.js - A JavaScript library to zip and unzip files
#20Anyone know of a Javascript implementation of Snappy? There's a binding for Node, but not a Javascript implementation which would be useful in the browser considering IndexedDB and Websockets support binary data.
No, but I've been using an LZMA library [1] to compress data sent over binary WebSockets. LZMA is nice for streaming data to many clients (i.e. compress once, decompress many times), because although compression time/CPU is high (LZMA > BZIP2 > GZIP), compression ratio is very good (LZMA > BZIP2 > GZIP) and decompression not too bad (BZIP2 > LZMA > GZIP) [2]. [1] http://code.google.com/p/js-lzma/ [2] Disclaimer: I sh…