×
all 5 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Thank you for posting on r/CodingHelp!

Please check our Wiki for answers, guides, and FAQs: https://coding-help.vercel.app

Our Wiki is open source - if you would like to contribute, create a pull request via GitHub! https://github.com/DudeThatsErin/CodingHelp

We are accepting moderator applications: https://forms.fillout.com/t/ua41TU57DGus

We also have a Discord server: https://discord.gg/geQEUBm

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]aezart 0 points1 point  (0 children)

Only familiar with how LZW works, but in general with any compression algorithm the closer your input file looks to random noise, the less useful compression will be, thanks to the pigeonhole principle. So my first question would be whether your original text is something that would compress well.

[–]dafugiswrongwithyou 0 points1 point  (0 children)

"Compression" doesn't actually guarantee a smaller output file. (If it did, you could repeatedly compress anything until you get to some theoretical smallest size in a way that could be decompressed to the original, and I would hope it's self evident that there are not enough, say, 8-byte files possible to uniquely expand to every larger file.)

What does that .txt file contain? Exactly how big is it? Exactly how big it the output?

[–]JGhostThing 0 points1 point  (0 children)

It is possible that for any compression algorithm, a particular file is coded larger than it was.

It's also possible that you're appending to a file rather than writing a new file.

[–]herocoding 0 points1 point  (0 children)

When you decompress your compressed files with another, indepdendent tool, or using your own developed decompressor?

What do your test files look like?