Using nsIZipWriter or other to compress a string as a string?

Posted by Daniel on Stack Overflow See other posts from Stack Overflow or by Daniel
Published on 2010-05-30T11:23:55Z Indexed on 2010/06/08 18:12 UTC
Read the original article Hit count: 190

Filed under:
|
|
|

I need to be able to take a javascript string, compress it using any fast and available means and get back a binary string/blob.

Background:

The extension I'm developing needs to send various large content to my server. It does this conveniently by dynamically creating a form, adding fields to the form and posting it. Some of these fields are just too big bandwidth wise for multiple use. I'd like to be able to compress them before adding them and then maybe base64'ing them if the characters cause a problem in the message. Any ideas?

I could use nsiZipWriter with temporary files on disk but that is quite ugly and probably sluggish.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about zip