[PLUGIN] Deflate

Post your completed addons to share with the community

Post » Fri Oct 19, 2012 8:30 pm

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: https://dl.dropbox.com/u/64479453/C2_Plugins/deflate.zip

Demo: https://dl.dropbox.com/u/64479453/C2_Plugins/DeflateDemo/index.html
Demo Deflate+Base32k: https://dl.dropbox.com/u/64479453/C2_Plugins/DeflateDemoWithBase32k/index.html

.capx: https://dl.dropbox.com/u/64479453/C2_Plugins/DeflateDemo.capx
.capx (need Base32k plugin): https://dl.dropbox.com/u/64479453/C2_Plugins/DeflateDemoWithBase32k.capxafgho2012-10-19 21:30:49
B
6
S
1
G
1
Posts: 18
Reputation: 1,004

Post » Tue Oct 23, 2012 9:14 am

@afgho : very useful plugin !
B
33
S
9
G
6
Posts: 709
Reputation: 6,704


Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests