Here is a skinny one (scroll down to see the problem): I am doing Huffman encoding to compress a file using PHP (for a project). I made a map and did everything in a line like:
00101010001100001110011101001101111011111011
Now I need to convert this to the actual binary string in the current state, this is just a string of 1s and 0s.
Here is the problem :
A line of 1s and 0s is 17,747,595 characters, and it really slows down by about 550,000
This is the code I have:
<?php $i=0 $len = strlen($binaryString); while ($i < $len){ $section = substr($binaryString,$i,$i+8); $out .= chr(bindec($section)); $i=$i+8; } ?>
How can I make it efficient enough to run a 17mm character string?
Thanks so much for any support!
source share