Module compress

Module compress 

Source
Expand description

Compression operations for Seq

These functions are exported with C ABI for LLVM codegen to call. Uses flate2 for gzip and zstd for Zstandard compression.

Compressed data is returned as base64-encoded strings for easy storage and transmission in string-based contexts.

§API

# Gzip compression (base64-encoded output)
"hello world" compress.gzip           # ( String -- String Bool )
compressed compress.gunzip            # ( String -- String Bool )

# Gzip with compression level (1-9, higher = smaller but slower)
"hello world" 9 compress.gzip-level   # ( String Int -- String Bool )

# Zstd compression (faster, better ratios)
"hello world" compress.zstd           # ( String -- String Bool )
compressed compress.unzstd            # ( String -- String Bool )

# Zstd with compression level (1-22, default is 3)
"hello world" 19 compress.zstd-level  # ( String Int -- String Bool )

Functions§

patch_seq_compress_gunzip
Decompress gzip data
patch_seq_compress_gzip
Compress data using gzip with default compression level (6)
patch_seq_compress_gzip_level
Compress data using gzip with specified compression level
patch_seq_compress_unzstd
Decompress zstd data
patch_seq_compress_zstd
Compress data using zstd with default compression level (3)
patch_seq_compress_zstd_level
Compress data using zstd with specified compression level