Eremey Valetov 5c01fec996 Add Phase 7 OpenTimestamps integration
uc2_sha256: pure-C FIPS 180-4 implementation, one-shot and incremental
API, validated against published vectors (empty, abc, 56-byte,
1M 'a', byte-by-byte, every-split-point boundary).

uc2_ots: parser, serializer, and walker for the standard .ots binary
format.  Strict canonical varint with 64-bit overflow check, depth-
bounded recursion, varbytes cap, max-digest cap.  Walker supports
the calendar-path subset (APPEND, PREPEND, SHA256); proofs that
include other crypto ops (SHA1, RIPEMD160, KECCAK256) are accepted
as structurally valid but flagged for follow-up via the standard
'ots verify'.

UC2-OTS trailer: magic-bracketed sidecar appended after the recorded
archive bytes.  Reverse-scan-safe; original UC2 Pro reader ignores
trailing bytes past its recorded length so backward compatibility is
preserved.  Layout (all integers little-endian uint32):
  front-magic + version + archive_len + proof_len + proof
  + proof_len + back-magic.

CLI: --ots-attach validates that the proof's leaf digest equals
SHA-256(archive[0..archive_len)) before appending and refuses to
overwrite an existing trailer unless -f is given.  --ots-extract
writes the proof verbatim, byte-compatible with the standard
'ots verify'.  --ots-info parses and prints the leaf, archive-match
status, and attestation list.  uc2 -t recomputes the archive
SHA-256 and walks the proof.

Tests: 17 OTS unit tests (varint round-trip, canonical/overflow
rejection, file-envelope round-trip, walker on append/sha256/
sibling/unsupported-op/truncated/trailing-garbage, attest_name,
trailer round-trip + corruption rejection in 4 scenarios).
Plus an optional ctest target ots_cross_check that round-trips
the .ots through python-opentimestamps when the package is
installed; skipped (return code 77) otherwise.
2026-05-03 12:15:30 -04:00

UC2 v3.0.0 -- UltraCompressor II

A cross-platform revival of UltraCompressor II, the DOS-era archiver by Nico de Vries (1992--1996). UC2 was notable for its advanced deduplication ("master blocks"), file versioning, and competitive compression ratios on the hardware of its day.

UC2 v3 brings it back as a modern, portable C99 tool with full backward compatibility -- archives created by UC2 v3 can be extracted by the original 1992 UC2 Pro, and vice versa.

Features

  • Full compression and decompression -- LZ77+Huffman (levels 2--5), rANS entropy coding (levels 6--9), LZ4 ultra-fast mode
  • Backward compatible with the original UC2 Pro (verified via automated DOSBox-X cross-tool round-trip testing)
  • Content-defined chunking (CDC) with Gear rolling hash for position-independent deduplication
  • Merkle DAG content addressing with 64-bit hashes
  • Cross-archive dedup via shared block store
  • Near-duplicate detection via SimHash
  • Delta compression for binary patching
  • Content-aware preprocessing -- BCJ (x86), BWT (text), delta filter
  • BLAKE3 cryptographic hashing for archive integrity
  • Benchmark mode -- test all methods on input data
  • Personality -- warm, confident status messages (-q for scripting)
  • Directory archival with nested hierarchies
  • Cross-platform: Linux, macOS, Windows (MSVC), DOS (DJGPP)

Building

Requires CMake >= 3.16 and a C99 compiler (GCC, Clang, or MSVC).

cmake -B build
cmake --build build
ctest --test-dir build    # 16 unit tests

Usage

uc2 -w archive.uc2 files...            # Create archive
uc2 archive.uc2                        # Extract all files
uc2 -l archive.uc2                     # List contents
uc2 -t archive.uc2                     # Test integrity
uc2 -d /tmp/out archive.uc2            # Extract to directory
uc2 -w -L 8 archive.uc2 files...      # Create with rANS Tight
uc2 -B files...                        # Benchmark all methods

Compression Levels

Level Method Description
2 Huffman Fast
3 Huffman Normal
4 Huffman Tight (default)
5 Huffman Ultra
6 rANS Fast
7 rANS Normal
8 rANS Tight
9 rANS Ultra

Levels 2--5 produce archives readable by the original 1992 UC2 Pro. Levels 6--9 use rANS entropy coding (UC2 v3 only, better compression).

Options

Flag Description
-w Create archive
-l List archive contents
-t Test archive integrity
-L n Compression level (2--9)
-B Benchmark all methods on input files
-d path Extract to specified directory
-f Overwrite existing files
-p Extract to stdout
-q Quiet (suppress status messages)
-a Include all file versions
-D Skip directory metadata; -DD also skips file metadata
-T Tab-separated output

Project Structure

UC2/
  lib/              libuc2 compression/decompression library
    include/uc2/    public headers (libuc2, uc2_cdc, uc2_merkle, uc2_rans, ...)
    src/            library implementation
  cli/              uc2 command-line tool
  tests/            unit tests and test corpus
  original/         preserved original UC2 Pro sources (reference only)
  docs/             Sphinx documentation

Credits

  • Nico de Vries -- Original UltraCompressor II (1992--1996)
  • Danny Bezemer -- Facilitated source code release (2015)
  • Jan Bobrowski -- Clean-room portable decompressor (unuc2/libunuc2, 2020--2021)
  • Eremey Valetov -- UC2 v3 revival, compression engine, deduplication, and ongoing development

See CREDITS.md for full attribution.

History

  • v1.0--v2.3 (1992--1996) Original DOS releases by Nico de Vries
  • 2015 Source code released under LGPL-3.0 by Danny Bezemer
  • 2020--2021 Jan Bobrowski writes unuc2/libunuc2 (portable decompressor)
  • 2026 UC2 v3.0.0: cross-platform revival with full compression engine, backward compatibility, and modern deduplication

License

GPL-3.0. See LICENSE and CREDITS.md.

Description
Cross-platform revival of UltraCompressor II (Nico de Vries, 1992-1996). C99, GPL-3.0.
Readme GPL-3.0 2.1 MiB
Languages
C++ 49.1%
C 41.8%
Batchfile 3.6%
CMake 2.3%
Python 1.6%
Other 1.6%