Hello everyone! Recently I created a library with the help of dekkonot’s BitBuffer and 1waffle1’s text compression library.
This library implements a modified zlib/DEFLATE algorithm. I used the modified LZW algorithm that 1waffle1 created and I optimized/fixed before using Huffman coding.
The result is a compression algorithm that is relatively more efficient at the cost of some time performance. Here’s an example of what it can do. I ran Shakespeare’s Twelvth Night into the algorithm and it cut the character down from 112,375 to 57,625. Below that are the results of the standalone LZW and Huffman compression.
I will put out that due to the nature of every compression algorithm, there is always the chance that you might end up with encoded text that is a longer than what you put in. This algorithm tends to do well when your text has a lot of repeated elements.
Also due to the nature of the Huffman coding algorithm it is relatively slower in execution time (I also blame Roblox for not letting me use bit manipulation on buffers) so you could try to fork it to use batch execution.