Home

Add a comment

 

Avatar: pieroxy

Re: demo page over reports the uncompressed size

It works or not depending on what you are trying to achieve. In JavaScript, all String are stored as UTF16, so all characters use up 16 bits of memory. That's the way it is and no matter what parameters you pass to lz-string, it will stay that way. Same goes for Indexed DB, localStorage and other JavaScript in-browser storage systems.

For example, storing 6 bits per character is important for String you are sending back to your server through a GET, because only 65 characters are allowed in there, the rest occupying 24 bits (at best) by being escaped in the form of %AB where AB is the ASCII code of your char in hexadecimal. Furthermore, those characters are being sent in UTF-8 (most of the time) and characters below 128 will occupy only 8 bits.

So it all depend on what you are trying to achieve with the result of the compression. Hence my question: What are you exactly trying to do with this?


Re: demo page over reports the uncompressed size


Title
Body
HTML : b, strong, i, em, blockquote, br, p, pre, a href="", ul, ol, li, sub, sup
OpenID Login
Name
E-mail address
Website
Remember me Yes  No 

E-mail addresses are not publicly displayed, so please only leave your e-mail address if you would like to be notified when new comments are added to this blog entry (you can opt-out later).

Home