go-compression / go-compression.github.io

The Hitchhiker's Guide to Compression
https://go-compression.github.io/
MIT License
136 stars 9 forks source link

LZ77 Encoder/Decoder is Buggy #2

Open phillipcutter opened 3 years ago

phillipcutter commented 3 years ago

https://www.reddit.com/r/programming/comments/j3bsi1/the_hitchhikers_guide_to_compression_a_beginners/g7bzd5r?utm_source=share&utm_medium=web2x&context=3

FYI your LZ77 visualiser is buggy.

Input: Potayto Potahto
Compressed: Potay<3,1><5,1><7,1><8,4><12,1><8,2>
Decompressed: PotaytoPPotaPto
AlgoRythm-Dylan commented 1 year ago

Agree, the encoder doesn't work at all. It seems to be, among probably a few other bugs, ignoring new symbols the second it finds its first back-reference. It's hard to believe this is one of the first results on google haha

phillipcutter commented 1 year ago

I think there's a lot of value in these docs besides some bugs in the interactive examples. There's also not a lot of easily consumable content on the subject, so I don't think the Google search ranking is such a surprise.

I'd love to tackle these bugs myself, but unfortunately I don't have the time. If you'd like to tackle them and submit a pull request, I'd be more than happy to review it.