Home

Add a comment

 

Avatar: pieroxy

Re: Just released: lz-string

 Wow... I can see quite a few mistakes here. First, you compress your content and then encode it in Base64 twice... Once with compresstoBase64 and once with Buffer.byteLength(..., 'base46'), hence, multiplying by ~1.8 its size. Looks like you need to read a bit about what is an encoding and what is compression.

Second, and this is a general advice whenever asking a question over the internet, we have no clue what you are trying to achieve. I mean, apart from calling LZString. What is it you want to do with LZString? Without this information, it's really hard to help you.

At last, what it looks like is that you're trying to compress some data on your server in order to send it to your client. Are you aware that pretty much all browsers and all webservers natively support compression? Furthermore, this is transparent, automatic and use gzip which is a far far better compression algorithm than LZString.

As I wrote in the documentation, LZString is meant to be used inside the browser. Of course, you can use it for other purposes, but then, be careful. It wasn't meant for that.


Re: Just released: lz-string


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