Skip to content
drsamonlinePublic

About

The CHCE browser front end. Convert, compress, minify, unpack and inspect files on your own device — no upload, no account, no server, no telemetry, and no CDN.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

48 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

a2z

a2z — The CHCE browser front end. Convert, compress, minify, unpack and inspect files on your own device — no upload, no account, no server, no telemetry, and no CDN.

The CHCE browser front end. Convert, compress, minify, unpack and inspect files on your own device — no upload, no account, no server, no telemetry, and no CDN.

live: online build: green tests: 362 assertions licence: PolyForm NC 1.0.0 offline: no network runtime deps: 0 CDN

Open the app → · The family · The .dr reader

The app: hero, workspace and the file queue

Documents

Document What it answers
PROJECT_OVERVIEW.md what CHCE is, the eight members, the boundaries, the licence strategy
AGENT_PROMPT.md the build plan: phases 0–8, each with its exit test
docs/STATE.md the resumable snapshot: where everything stands, and how to pick it up cold
docs/STATUS.md what is done, what is left, and the evidence for each
docs/ENHANCEMENTS.md every enhancement on the menu, ranked, with effort, risk and owner
docs/ZIPTASTIC.md the CHCE v8 format as this reader implements it, and why the encoder is not here
docs/COMPRESSION.md the engine: Compression Streams, fflate, and the store rule
CHANGELOG.md every release, with the assertion count at that tag
SECURITY.md · PRIVACY.md · NOTICE.md the policy surface

What it does

Action What happens
Inspect a ziptastic .dr Header, flags, Layer 0 transforms, block table from the v8 offset table, and the manifest digest verified in the browser with WebCrypto.
Smart optimize Picks per file from the extension: images convert, audio goes to Opus, text minifies, PDFs re-save, ZIP-based packages recompress, everything else is gzipped. A file a codec cannot handle is preserved in a ZIP, never dropped.
Compress to ZIP One archive from a batch, DEFLATE per entry at Fast / Balanced / Maximum. Entries that are already compressed — a JPEG, an .xz, a .docx — are stored, not deflated for nothing.
Compress to gzip (.gz) The format a web server or a log pipeline expects.
Compress to deflate (.zz) The raw zlib stream an HTTP body carries.
Extract a ZIP Every entry written back out, folder structure kept, names sanitised.
Decompress .gz / .zz Detected from the first bytes (gzip 1f 8b, zlib header check), not from the file name.
Convert / compress image JPEG, PNG, WebP out, at three qualities — or to a byte budget, by searching for the highest quality that fits.
Convert audio to Opus Decoded with WebAudio, recorded as Opus at 64, 96 or 128 kbps.
Minify code or text HTML, XML, SVG, CSS, JS, JSON, JSONL, notebooks. Conservative on scripts.
Optimize PDF Re-saved with object streams. May not shrink a file; it says so instead of pretending.
Repack Office / OpenDocument A .docx or .epub is unpacked and recompressed entry by entry — and handed back untouched if the result grew.

Every result is measured against its input and labelled smaller, same size or larger. A result that grew is not presented as a win.

The CHCE family

a2z is one of eight repositories in the CHCE family — Chimera Hybrid Compression Engine. The family's architecture, hard rules and boundaries live in PROJECT_OVERVIEW.md, which is shared byte for byte with HCS, ziptastic and heavenzip.

Repo Its one job Licence
HCS the vendored source vault CC0 / MIT
ziptastic the engine — the CHCE / .dr format MIT
heavenzip the orchestrator — chains binaries MIT
kosh the file workbench — split, squeeze, verify —
lexora the text canonicaliser —
compfactory the rules — workspace sync and build MIT
smlz the browser front door — ZIP and TAR in a tab PolyForm NC 1.0.0
a2z the CHCE reader, and the conversion bench PolyForm NC 1.0.0
HCS ──(vendored, read-only)──▶ ziptastic ──(release binaries)──▶ heavenzip
                                    │                                 │
                                    │ .dr                             │ .hzpkg
                                    ├──────────────▶ kosh  (workbench)
                                    ▼                                 ▼
                         a2z  (browser, reads it)            any decompressor

The other browser member

smlz is also a browser tool, and both apps can produce a ZIP. That overlap is stated in PROJECT_OVERVIEW.md rather than hidden, because the two jobs are different:

smlz a2z
The job the front door for ordinary archives the reader of the CHCE stream, and the conversion bench
A .dr recognises it, names the member that reads it reads it: header, block table, manifest
Images, audio, PDF, minify not its job its job

A person holding assets.dr needs a2z. A person holding a ZIP of PNGs needs smlz.

a2z's boundary, in the family's own terms. It reads a CHCE stream: header, flags, Layer 0 bytes, block headers, trailer, offset table, manifest. It compresses ordinary files with the platform's codecs. It does not implement a CHCE backend — no rANS, no BWT, no PPMd, no context mixing — it does not write a .dr, and it does not decode a payload and call that verification. The encoder is ziptastic; the boundaries are the safety mechanism.

a2z and smlz are the family's licence exception, recorded in PROJECT_OVERVIEW.md §6: the format and the engines stay permissive so anyone can build on them, and the end-user apps that wrap them are noncommercial.

Reading a .dr archive

ziptastic writes CHCE v8: per block, nine encoders compete and the smallest wins; eighteen Layer 0 transforms sit above them; every block carries its own SHA-256 and the stream carries a manifest digest over the block headers.

The encoder cannot run in a browser, and this app does not pretend otherwise. There is no WebAssembly build of the engine, its codecs are native code, and compiling the stack (liblzma, libbsc, PPMd, the context mixer) is a project of its own. So a2z does the half that is exact in JavaScript:

  • parses the stream header, the per-block headers and the v8 trailer;
  • locates the trailer by arithmetic — end − 4 − 8 × blockCount − 32 − varintLen − 4 — without walking a single block;
  • checks that the sizes add up, that the offsets strictly increase and stay inside the stream, that every payload fits between its header and the next block, and that the header and trailer agree on the block count;
  • recomputes the manifest digest — SHA-256 over every block header in order: mode byte, both sizes as varints, the block's own digest — and compares it with the trailer. A dropped, duplicated, reordered or edited block fails there, before any payload is decoded;
  • decodes the flag bits and all three Layer 0 bytes into the transform names they stand for;
  • honours the stub rule: offset-table entries count from the C of CHCE, not from byte 0, so an SFX stub in front of the stream changes nothing.

The .dr report: verdict, header, block table and fourteen integrity checks

What it cannot prove is that a payload decodes to the right bytes. That needs ziptastic d, and the app says so where it reports.

ziptastic c assets/          # → assets.dr
ziptastic d assets.dr        # → byte-identical
ziptastic info assets.dr     # → header, block table, offsets

docs/ZIPTASTIC.md has the full account: field order, the manifest, the stub rule, and every check with what failing means. docs/COMPRESSION.md covers the engine a2z does run.

What it refuses to do

  • It does not upload, and it cannot: there is no server and no network request in the page.
  • It does not call a conversion successful because it finished. Every result is measured and labelled.
  • It does not convert a script, an executable, a PDF or an Office document into an unrelated format. Unsupported types are packaged unchanged.
  • It does not decode a .dr. It reads the container and verifies its integrity, and says which of the two it did.
  • It does not treat "compressed" as "smaller": a package that grows is returned as it came in.

Verified

Two suites, no framework, no install:

node test-node.js        # 216 assertions — the reader, the engine, and four streams the engine wrote
node browser-check.js    # 146 assertions — the page, driven in headless Chromium
python3 scripts/badges.py  # regenerates docs/assets/badge-*.svg from the counts above

# with a ziptastic binary to hand, the strongest check there is:
node scripts/cross-check.js ./ziptastic-1.4.5-linux-x86_64   # 116 fields, reader vs engine
node scripts/fuzz.js 3000                                    # mutated input, no throw
node scripts/a11y-check.js                                   # axe: 0 violations (needs axe-core)

test-node.js writes CHCE streams the way block_writer.cpp writes them — header, blocks, offset table, ZTIX/ZTOX, manifest — then reads them back and breaks them on purpose: a v7 stream, a reserved flag bit, an edited block digest, a size that no longer adds up, a stream truncated inside its trailer. It also round-trips gzip, deflate and ZIP byte for byte, proves a .jpg is stored rather than deflated, and proves a duplicate entry name is suffixed instead of overwritten.

scripts/cross-check.js runs the engine's own info on the four fixtures and compares every field both sides can report — version, sizes, CRC-32, block count, block access, layer bytes, and each block's offset, sizes and backend. It runs in CI against the v1.4.5 release binary.

browser-check.js serves the repository through request interception on http://localhost/ (a secure context, so crypto.subtle exists), then checks that no request leaves the origin, that the vendored stylesheet and font apply, and that gzip, a batch ZIP and the .dr report all work through the real controls.

Phases

The build plan is AGENT_PROMPT.md. Commits are tagged phase-<N>: <description>, as the family does.

Phase What State
0 The app as received: three static files, CDN-loaded Tailwind, JSZip, pdf-lib ✅ 1.0.0
1 Vendor everything; delete every CDN reference ✅ 2.0.0
2 The compression engine: gzip, deflate, ZIP with levels, store rule, extraction ✅ 2.0.0
3 The CHCE reader: header, blocks, trailer, offset table, manifest digest ✅ 2.0.0
4 The report UI: header grid, block table, fourteen checks, copy/save ✅ 2.0.0
5 Family adoption: PROJECT_OVERVIEW.md, AGENT_PROMPT.md, local badges, phase table, screenshots, the fleet nav ✅ 2.1.1
6 i18n — English, Hindi, Gujarati not started
7 Service worker, so one visit is enough to run offline not started
8 Payload verification — only if a WebAssembly build of ziptastic ever ships not started

Layout

index.html          the page
theme.css           design tokens and the two vendored fonts
styles/app.css      Tailwind, built once and committed (scripts/build-styles.sh)
app.js              the UI
compression.js      the engine: gzip, deflate, ZIP, unzip, repack
worker.js           that engine, off the main thread
sw.js               the offline cache — the app's bytes, never yours
engine.js           the main-thread client: one job at a time, progress, cancel
dr-inspect.js       the CHCE v8 reader
vendor/             export-kit, fflate, pdf-lib — all vendored, read-only
assets/fonts/       DM Sans and Manrope, variable woff2
docs/               ZIPTASTIC.md, COMPRESSION.md, badges, screenshots
scripts/            build-styles.sh, badges.py, shot.js
test-node.js        the node suite
browser-check.js    the headless-browser suite

Nothing is built at runtime. index.html plus its files is the app; open it from a web server, or from a USB stick.

Deployed on GitHub Pages only — branch main, folder /, no build step and no other host. Live at https://drsamonline.github.io/a2z/. The source is the download: git clone https://github.com/drsamonline/a2z.git.

Licence

PolyForm Noncommercial 1.0.0 — free for personal, hobby, educational and other non-commercial use; commercial use needs a paid licence. The vendored libraries carry their own MIT and Apache-2.0 terms, and the two fonts are OFL; see NOTICE.md. The CHCE format and the engines stay permissive — see PROJECT_OVERVIEW.md §6.

Made by Dr. Sohil Momin.


Support

Sponsor: GitHub Sponsors · Ko-fi · PayPal · books · UPI drsohilboi@ybl — free, offline, no account

Nothing is gated behind it: no accounts, no tracking.

About

The CHCE browser front end. Convert, compress, minify, unpack and inspect files on your own device — no upload, no account, no server, no telemetry, and no CDN.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages