Use uorc here
- Pick what to do: Compress, Decompress, Inspect or Verify.
- Choose the files, folder or archive it asks for.
- Press the button under the fields, then save the result. Cancel stops a running operation at once.
Make a .uorc archive from files or a folder.
One file becomes NAME.uorc with exactly the bytes the uorc command line writes. Several files or a folder become one archive that keeps their relative paths.
Restore the files a .uorc archive holds.
Any archive the page or the command line wrote. An archive of one file restores that file; an archive of several files or a folder lists every file to save.
See what an archive holds without decoding it.
Reads each archive header of the stream and checks its integrity seal. Fast for any size.
Check that an archive decodes, and optionally that it reproduces an original.
Decodes the whole archive without saving anything. Give the original file too and every byte is compared.
One or more files. Choosing files clears a chosen folder.
Every file under one folder, with its relative paths. Choosing a folder clears chosen files.
A .uorc file written by this page or the uorc command line.
The file the archive should reproduce. Leave empty to check only that the archive decodes.
Loading the uorc WebAssembly client…
Examples
Each example compresses a built-in input in this page, decompresses the archive again and checks that the bytes are identical.
- English text: This page's own guidance and purpose, repeated: prose compresses well. (16384 bytes)
- Zero bytes: One run of a single byte value. (65536 bytes)
- Counter bytes: Every byte value 0 to 255 in order, repeated. (4096 bytes)
- Random bytes: Bytes from the browser's random source: they do not compress, and the archive stores them as they are. (16384 bytes)
- Empty input: No bytes at all. (0 bytes)
| Input | Bytes | Archive bytes | Round trip | Seconds |
|---|
What the codec claims
The statements this release makes about its own performance, as the factory decided them: theorems checked for every input, exact sizes and step counts on named corpora, and the state of the engine that searches the codec space. Each codec point and corpus is named by its κ, a SHA-256 identity.
Performance theorems and measurements
| Claim | Statement | Evidence |
|---|
Closed claims
| Form | Codec point κ | Corpus κ | Bytes | Steps | Decided |
|---|
Engine
| Strategy | Family | Weight |
|---|
What the page does
uorc is Universal Object Reference Compression. Each archive is an exact executable object reference: it carries the program that rebuilds the original, and an integrity seal over itself.
This page runs the same uorc client as the command line, compiled to WebAssembly. Compress writes the same bytes, Decompress reads every archive the command line writes, and Verify checks an archive without saving anything.
Large inputs stream through 8 MiB frames, so a file of any size goes through a few frames of memory at a time. Several files or a folder are compressed together in memory as one archive of ordered objects: a manifest of relative paths, then each file.
Use uorc elsewhere
Command line
uorc compress --stats notes.txt # writes notes.txt.uorc
uorc decompress notes.txt.uorc -o notes.restored.txt
cat data.bin | uorc compress - > data.uorc # any size: streams through 8 MiB frames
uorc compress --threads 4 big.tar # frames compress in parallel
uorc decompress --threads 4 big.tar.uorc # blocks of frames decode in parallel
uorc compress photos/ # writes photos.uorc (a whole tree)
uorc decompress photos.uorc -o restore/ # --resume finishes an interrupted restore
uorc inspect notes.txt.uorc # per frame: header, integrity, codec point and steps; no decoding
uorc verify notes.txt.uorc notes.txt # decode, check, compare
# Outputs are written to a temporary file and renamed into place; --force replaces.
# Exit status: 0 ok, 2 usage, 3 I/O, 4 invalid archive or integrity, 5 step budget,
# 6 overflow, 7 differs from the original.
Rust library
let archive = uorc::compress(&bytes, uorc::DEFAULT_STEPS)?;
let original = uorc::decompress(&archive, uorc::DEFAULT_DECODE_WORK)?;
assert_eq!(original, bytes);
let info = uorc::inspect(&archive)?; // header + integrity, no decode
let point = uorc::performance::CodecPoint::of(&info); // basis, profile, state, lanes; point.kappa()
uorc::verify(&archive, Some(&bytes), uorc::DEFAULT_DECODE_WORK)?;
let many = uorc::compress_objects(&[a, b, c], uorc::DEFAULT_STEPS)?;
let parts = uorc::decompress_objects(&many, uorc::DEFAULT_DECODE_WORK)?;
// Or stream between any reader and writer, with bounded memory:
uorc::compress_stream(reader, writer, uorc::DEFAULT_STEPS, uorc::default_threads())?;
JavaScript (this page's module)
import { load } from "./uorc.js";
const uorc = await load("./uorc_bg.wasm");
const archive = uorc.compress(new TextEncoder().encode("hello hello hello"));
const original = uorc.decompress(archive);
uorc.inspect(archive); // [{ representation, codec_point, steps, integrity_ok, ... }]
uorc.verify(archive, original); // throws if it does not reproduce original
const bundle = uorc.compressFiles([{ path: "a.txt", data }, { path: "d", kind: "directory" }]);
const files = uorc.decompressFiles(bundle); // [{ path, kind, data }]
// Files of any size, one frame in memory at a time:
const blob = await uorc.compressBlob(file);
const back = await uorc.decompressBlob(blob);
// Folders of any size, the same way:
const tree = await uorc.compressTreeBlob([{ path: "d", kind: "directory" }, { path: "d/a.txt", blob: file }]);
const entries = await uorc.decompressTreeBlob(tree); // [{ path, kind, blob }]