I need two PHP functions coded to compress an ASCII string of any length (approx 7-8 thousand characters) to a "compressed" output. The compressed string (alphanumeric) should not have more than 80 characters into it.
Function Decompress ($string)
$str = "This is a long string that may contain any printable ASCII characters, including but not limiting to ~!#$%':232\"()_+. and escaped characters"
$cstr = compress($str)
echo $cstr // This should display an alpha-numeric string upto 80 char or less.
$dstr = decompress($cstr)
echo $dstr // This should display the same content as $str
I don't want to rely on any libraries (e.g. bzcompress) or gzip for these functions to work.
Just simple byte/bit shifting or hashing algorithm should do the job I think.
To give you better understanding, I have a advance search page into my application which generates the dynamic SQL query based on the user's selection criteria from the advance search page. Sometimes query might get very complex and the entire length of the query becomes somewhere upto 8000 characters. So I want to compress the entire query (into alphanumeric characters).
Pls note. Only serious bidders will be entertained.
4 pekerja bebas membida secara purata $58 untuk pekerjaan ini
It's impossible to compress 8000 bytes to 80 (100 times!) and then decompress it. But I sure, we can find ways to solve your problem. Please, give more details