E
E
Evgeny Popov2011-09-07 10:24:17
Python
Evgeny Popov, 2011-09-07 10:24:17

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

4 answer(s)
A
Anatoly, 2011-09-07
@taliban

How well does it compress, how much data do you have, and is it worth it?

E
equand, 2011-09-07
@equand

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

R
Ruslan_Y, 2011-09-07
@Ruslan_Y

Look, it seems what you need (LZJB algorithm):
code.google.com/p/jslzjb/ and for python code.google.com/p/pylzjb/

A
akzhan, 2011-09-07
@akzhan

stackoverflow.com/questions/298745/how-do-i-send-a-cross-domain-post-request-via-javascript

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question