Background
This is a simple algorithm for compressing data. Can be effective for datastores as long as you have repeating patterns. There are no downsides to using it but it may not be as effective in data without repeating phrases.
Use cases
I am still keeping it open in case anyone wants to learn more about data compression or has a specific use case. This compression algorithm requires data that has frequent patterns however and may not work in diverse systems.
Yes. If it exceeds 4mb. That way it can be infinitely big. (well not infinitely because you still have to abide by the rate limits, but enormously big that virtually no player will ever reach it)
You can use string.len() and httpservice:JSONEncode() to get the size in bytes of the table.
To be clear, I’m not against compression. Honestly I never made something where I had to think about it. If I do I’ll keep this resource in mind. Thanks for it!
What if your compressing data to be sent over a remote? The amount of time it takes to compress and decompress is negligible compared to the latency of sending data. That latency also decreases with compressed data.