News for hackers. Stuff that matters.
Re:Zip.js - A JavaScript library to zip and unzip files by jorangreef on Wednesday February 01, 2012 @08:58AM (#3537910)
Anyone 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.
Re:Zip.js - A JavaScript library to zip and unzip files by gmac on Wednesday February 01, 2012 @09:11AM (#3537950)
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 should check, but haven't yet, whether these inequalities hold for this JS LZMA implementation relative to the available GZIP and BZIP2 ones.

Re:Zip.js - A JavaScript library to zip and unzip files by jorangreef on Wednesday February 01, 2012 @11:38AM (#3538678)
Thank you, I spotted BZIP2 and LZMA. Looking for compression/decompression cpu cost of X < GZIP < BZIP2 < LZMA where compression ratio is of secondary concern.