compress string of data

J

José Carlos

Hi.

How i could compress string of data?.

I heart that it´s possible to make with librep, but i´dont know the way to
do it.

if somebody know any way to do it or any web where explain it i would thank
the help.

Regards.

José Carlos
ADV
www.siadv.com
 
I

Irmen de Jong

José Carlos said:
How i could compress string of data?.

Type "python compress string of data" in google and press "I'm feeling lucky".
That might help you out.

--Irmen
 
T

Terry Reedy

Josiah Carlson said:
There is no such thing as universal compression

Only if you specify invertibility (losslessness).

f(s) == '' compressess everything except '' itself ;-)

and that len(f(s)) < len(s) for some s and not just <= for all s (which
allows identity 'compression' f(s) == s).
- some compressions result in expansion.

Which is to say that if a 1-1 function maps some strings to smaller
strings, it must correspondingly map others to larger strings. An
interesting CS tidbit that people keep discovering by stumbling over.

Lossless universal expansion is possible: f(s) == ' '+s. But it is into
rather than onto, so only strings starting with ' ' can be inversely
mapped.


Terry J. Reedy
 
J

Josiah Carlson

Terry said:
Only if you specify invertibility (losslessness).

f(s) == '' compressess everything except '' itself ;-)

and that len(f(s)) < len(s) for some s and not just <= for all s (which
allows identity 'compression' f(s) == s).




Which is to say that if a 1-1 function maps some strings to smaller
strings, it must correspondingly map others to larger strings. An
interesting CS tidbit that people keep discovering by stumbling over.

Lossless universal expansion is possible: f(s) == ' '+s. But it is into
rather than onto, so only strings starting with ' ' can be inversely
mapped.

Exactly (I was too short on time to say the equivalent this morning, and
even if I had said the equivalent, it likely would not have been as clear).

- Josiah
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top