A simple plugin to compress/decompress a string using deflate algorithm, it use js-deflate/js-base64, i needed this in order to send/receive heavy data over websocket but it can be used to save localstorage space, it is useless though if you use it to compress small string.
2 expressions to use:
- Deflate.Compress(string, compression-level)
- Deflate.Decompress(string)
Compression-level can be 1 (poor but fast) to 9 (best but slowest)
The "Compress" function also encode the compressed data using Base64, the string passed to the decompress function should also be Base64 encoded.
Note: Base32k plugin "compress" better sometime (depend on data) but Deflate can be used with Base32k to compress even more (up to 2.5x, look at the demo), it is slower though.
Plugin: dl.dropbox.com/u/64479453/C2_Plugins/deflate.zip
Demo: dl.dropbox.com/u/64479453/C2_Plugins/DeflateDemo/index.html
Demo Deflate+Base32k: dl.dropbox.com/u/64479453/C2_Plugins/DeflateDemoWithBase32k/index.html
.capx: dl.dropbox.com/u/64479453/C2_Plugins/DeflateDemo.capx
.capx (need Base32k plugin): dl.dropbox.com/u/64479453/C2_Plugins/DeflateDemoWithBase32k.capx