←back to thread

181 points ekiauhce | 2 comments | | HN request time: 0.418s | source
Show context
echoangle ◴[] No.42225231[source]
I didn’t quite get the method used to „compress“ the data from the article, maybe this rephrasing helps someone:

You basically split the file every time you encounter a specific character, and your compressor just combines all files it finds with the character you split by. If you split at every „X“ Char which might occur 1000 times in the file, the compressor only needs a small script which joins all files and puts an „X“ between them, which is less than 1000 bytes. The „trick“ is storing the location of the Xs you removed in the file sizes of the individual files.

replies(2): >>42231484 #>>42234164 #
1. oezi ◴[] No.42231484[source]
My take was that the information is stored in the ordering of the files. The decompressor doesn't care about the file size of each file, right?
replies(1): >>42232216 #
2. Dylan16807 ◴[] No.42232216[source]
Both are needed. If you want to transmit this solution from one computer to another you need to store the size of each file (or insert a fancy delimiter that takes even more space).