Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Another implementation of paradoxical compression, which, applied recursively also allows for infinite compression (ie. down to 0 byte) of any file:

https://cs.fit.edu/~mmahoney/compression/barf.html

Of course, there's a catch.



Given that barf is already using the filename to indicate the compression, why not just move the final byte of the file into the filename instead? Something like,

    head -c -1 "$file" > "$file$(tail -c1 "$file")"
EDIT: Obviously this has the corner case of null bytes


That's actually pretty much what BARF is doing already; that's the catch.


Haha, you're right. I should really read the source before speculating next time.


Is he just moving bytes from the file into the file name? He should count the increased size of the file name in the size of the compressed file otherwise he’s not counting all of the essential data you need for the decompression.

You can decompress a gzip file without the file name (think about tar using a pipe.)


I'm pretty sure barf is a joke?


How do you tell the difference between a joke and a compression crank?


In this very specific case because the author, Matt Mahoney, is one of the most respected experts in the field of lossless data compression. But yeah, in some case the difference is hard to tell.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: