A Zig library and small command line tool for compressing and decompressing Uxn LZ Format (ULZ) things.

Files
README.md

ulzig #

A Zig library and small command line tool for compressing and decompressing things with the Uxn LZ Format (ULZ). This is a port of a C implementation that's a part of uxn-utils by Hundred Rabbits.

Usage #

Zig #

const ulz = @import("ulz");

const decoded = try ulz.decode(allocator, @embedFile("file.ulz"));
defer allocator.free(decoded);

const encoded = try ulz.encode(allocator, "compress meeeeee");
defer allocator.free(encoded);

Getting Started #

To import ulz in your project, run the following command:

zig fetch --save git+https://github.com/coat/ulzig

Then set add the dependency in your build.zig:

const ulz = b.dependency("ulzig", .{
    .target = target,
    .optimize = optimize,
})

mod.root_module.addImport("ulz", ulz.module("ulzig"));

CLI #

Compress the file foo into foo.ulz:

ulz foo

Decompress foo.ulz into foo:

ulz -d foo.ulz

Installation #

Download the latest release from GitHub and place the binary in your PATH.

Nix #

nix run github:coat/ulzig

Prior Art #

Original implementation in C that this code was based on.