Expand description
Data compression and decompression utilities.
Functionsยง
- compress
- Compresses data using the specified algorithm.
Returns compressed data with 1-byte header:
[algorithm_id][compressed_data]Returns original data with header[0][original_data]if compression is disabled or ineffective. - compress_
with_ buffer - Compresses data using the specified algorithm with a provided output buffer. This version reuses the output buffer to reduce allocations in hot paths. Returns the compressed data, reusing the provided buffer when possible.
- decompress
- Decompresses data based on the 1-byte header.
Header format:
[algorithm_id][data]