compress.lz provides pure V implementations of several LZ-family codecs.
Supported formats:
lz77lz78lzwlz4lzsslzmalzma2lzjbUse the generic API when selecting a format dynamically:import compress.lz
encoded := lz.compress('hello hello hello'.bytes(), .lz77)!
decoded := lz.decompress(encoded, .lz77)!
assert decoded.bytestr() == 'hello hello hello'
Use the format-specific APIs for direct calls:import compress.lz
encoded := lz.compress_lzw('banana banana'.bytes())!
decoded := lz.decompress_lzw(encoded)!
assert decoded.bytestr() == 'banana banana'