Hacker News new | ask | show | jobs
by qntm 5005 days ago
Suppose the random file is 3,000,000 bytes long and happens to contain 135 bytes "X". Split the file on the letter "X" into 136 smaller files, each with no X in it. Then, return the files along with a "decompressor" script which says something like:

    return(join("X", files 1 to 136))
Since the script takes up fewer bytes than the 136 "X" bytes would, the total size of the 136 files + decompressor script is less than the size of the original file.