Home

Add a comment

 

Re: demo page over reports the uncompressed size

I believe one can get single-byte (8-bit) chars by using 8 bitsPerChar in compress and 128 resetValue in decompress like so:
compress8=function(uncompressed){
  //return LZString._compress(uncompressed,16,function(a){return String.fromCharCode(a);});
  return LZString._compress(uncompressed,8,function(a){return String.fromCharCode(a);});
}

decompress8=function(compressed){
  if (compressed == null) return "";
  if (compressed == "") return null;
  //return LZString._decompress(compressed.length,32768,function(index){return compressed.charCodeAt(index);});
  return LZString._decompress(compressed.length,128,function(index){return compressed.charCodeAt(index);}); 
}
Works for me anyway.

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