Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add string compression functions #3020

Merged
merged 3 commits into from
Apr 5, 2024
Merged

Conversation

Denneisk
Copy link
Member

Adds compress(string) and decompress(string) functions that use Gmod's built-in compression system. decompress throws on an input string that isn't LZMA compressed.
The compression is very fast, with inputs of 64k+ characters barely taking any time, so I think the op counter limit is fine where it is.

I swear I'm going crazy thinking these existed. Maybe it was something else I was testing.

@thegrb93
Copy link
Contributor

You definitely need to limit input string length because compress is not a linear o(n) algorithm.

@thegrb93 thegrb93 merged commit bc614de into wiremod:master Apr 5, 2024
1 check passed
@Denneisk
Copy link
Member Author

Denneisk commented Apr 5, 2024

Was gonna merge these after workshop deploy :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants