This is a Go port of Michael Schindler's szip 1.12b. It reads and writes
the original .sz format. The original source and documentation are in
legacy/; the source archive is retained in the project root.
Build with go build -o szip . or run with go run ..
szip [options] [inputfile [outputfile]]
Without filenames, szip reads standard input and writes standard output.
Options can be combined, for example -b14o4r3i.
| Option | Meaning | Default |
|---|---|---|
-d |
Decompress | Compress |
-bN |
Block size in 100 kB (1–41) | 17 |
-oN |
Context order (0 or 3–255; 0 = BWT) | 6 |
-rN |
Record size in bytes (1–127) | 1 |
-i |
Encode differences between consecutive bytes | Off |
-vN |
Verbosity (0–255) | 0 |
For example:
szip input.txt input.sz
szip -d input.sz restored.txt
Run go test ./... to test round trips. For interoperability tests against
the original implementation, first build it with make -C legacy szip,
then run go test ./... again.
The GitHub Actions workflow runs tests and builds
amd64 and arm64 .deb packages on pushes, pull requests, and manual runs.
Download the packages from the workflow's artifacts. Each push to main also
updates the development prerelease with the latest packages. A tag such as
v1.12.0 creates a versioned GitHub Release with both packages attached. The .deb includes
the original distribution's readme.txt under /usr/share/doc/szip/.
To build a package locally (requires Go and dpkg-deb):
bash scripts/build-deb.sh 1.12.0 amd64
The original distribution's copyright and distribution conditions are
documented in legacy/readme.txt; licenses for some
individual modules are included in their original source files.