Home

Add a comment

 

Re: Just released: lz-string

 <span style="font-family: 'Trebuchet MS', 'Lucida Grande', Tahoma, Verdana, Arial, sans-serif; font-size: 16px; line-height: 24px; background-color: rgb(240, 240, 240);"> 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.</span>

?? <span style="background-color: rgb(240, 240, 240); font-family: 'Trebuchet MS', 'Lucida Grande', Tahoma, Verdana, Arial, sans-serif; font-size: 16px; line-height: 24px;">Buffer.byteLength(..., 'base46')</span> gives me the compression length
<span style="font-family: 'Trebuchet MS', 'Lucida Grande', Tahoma, Verdana, Arial, sans-serif; font-size: 16px; line-height: 24px; background-color: rgb(240, 240, 240);">Buffer.byteLength(msg, 'utf8') gives me the non-compression length</span>

If the compression is smaller then I send the compressed data to the client using socket.io (websocket/flash/ajax/etc)
If the compression is not smaller then I send the non-compressed data to the client using socket.io

Socket.io don't use <span style="background-color: rgb(240, 240, 240); font-family: 'Trebuchet MS', 'Lucida Grande', Tahoma, Verdana, Arial, sans-serif; font-size: 16px; line-height: 24px;">gzip for the messages.
So that's why i'm searching for a compressed method to send the messages to the clients and back using javascript.
I works now great, with some small compression in some text messages.</span>


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