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.
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);To import ulz in your project, run the following command:
zig fetch --save git+https://github.com/coat/ulzigThen 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"));Compress the file foo into foo.ulz:
ulz fooDecompress foo.ulz into foo:
ulz -d foo.ulzDownload the latest release from GitHub and place the binary in your PATH.
nix run github:coat/ulzig
Original implementation in C that this code was based on.