Library fastlz

FastLZ library. Provides compression and decompression using the LZMA method.

Functions

compress( string ) Compresses the given string into an LZMA1 (FORMAT_ALONE) binary sequence.
decompress( string, maxSize ) Decompresses the given string.


Functions

fastlz.compress( string )
Compresses the given string into an LZMA1 (FORMAT_ALONE) binary sequence. Note that for very small strings, the output of this function may be larger than the original string.

Environment:

Shared

Parameters:

  • (string) string: The string value to be compressed.

Return value:

    (string) The compressed string.
fastlz.decompress( string, maxSize )
Decompresses the given string. If compressing data outside of GMod to pass into this function, use the LZMA1 format (FORMAT_ALONE), and ensure that the size of the decompressed payload is provided starting at the 6th byte as an 8 byte little-endian integer.

Environment:

Shared

Parameters:

  • (string) string: The string value to be decompressed (compressed with fastlz.compress()).
  • (number?) maxSize: An optional size limit in bytes after which decompression will be stopped.

Return value:

    (string) The decompressed string.

Valid XHTML 1.0!