nullpunkt / lz-string-php

PHP Class implementation of LZ-String javascript
105 stars 54 forks source link

Check if a string is compressed #4

Closed davidsoderberg closed 9 years ago

davidsoderberg commented 9 years ago

Hi, How can I check if a string is already compressed?

nullpunkt commented 9 years ago

Hi,

you can't. But i think you should solve this issue outside of the (de)compression part. For example you can prefix your compressed string and/or directly send it to the interface/function which knows what to do. So when your sender sends a compressed string to the receiver he should know if the message (string) is compressed or not -> and inform the receiver of its content (by using another url, function, etc. for each case)

Greetings