nimlz4

Nim wrapper for the LZ4 library. There is also a high-level API for easy use

Wrapper score 15/100 · tests present · no docs generated

Wraps a native library — check OS Compatibility below for platform-specific linking notes.

Summary

Latest Version Unknown
License BSD
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install nimlz4
choosenim install nimlz4
git clone https://github.com/dfdeshom/nimlz4.git

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
nimlz4 - - - - - - -

Source

Repository https://github.com/dfdeshom/nimlz4.git
Homepage https://github.com/dfdeshom/nimlz4
Registry Source nimble_official

README

nimlz4

Nim wrapper for LZ4

Simple compression (block API)

Use this API when you don't care about interoperability and assume only this wrapper will be used to compress and decompress strings:

import lz4
var input = readFile("LICENSE")
var compressed = compress(input,level=1)
var uncompressed = uncompress(compressed)
echo(uncompressed==input)

If you would like a better compression ratio at the expense of CPU time, use compress_more().

Frame compression (auto-framing API)

Use the frame API when you want your compressed data to be decompressable by other programs.

import lz4
var prefs = newLZ4F_preferences()
var compressed = compress_frame(input,prefs)
var decompressed = uncompress_frame(compressed)
echo(input == decompressed)