Answer the question
In order to leave comments, you need to log in
Choosing how to compress a string on the client side (js) and decompress on the server side (python)?
Let me know if anyone has come across a solution to the problem. This library was found dankagai deflate . When trying to use zlib or gzip python modules, it turns out that the data is in some “other format” than suitable for working with these modules. The only option that I found is to rewrite the inflate function from this library from js to python.
I started digging in the direction of the algorithms that are used on “link shortening services”, but judging by the information found, the principle of work in them is somewhat different, but I could be wrong. I would like to know about examples of implementation and / or direction in which direction to move in search of a solution.
Answer the question
In order to leave comments, you need to log in
How well does it compress, how much data do you have, and is it worth it?
Turn on the return of the deflate python header to compression and if the client (browser) supports, and it supports (Accept-Encoding the header), turn it on if my memory does not change zlib.compress to http data
This is how it works for me and works without problems in the project issuing json api
Look, it seems what you need (LZJB algorithm):
code.google.com/p/jslzjb/ and for python code.google.com/p/pylzjb/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question