Honzo
The "ideal" ebook format.
Honzo is a binary ebook format designed for simplicity, performance, and portability.
Features
| Feature | Description |
|---|---|
| Zero-copy parsing | Read without allocating: embeddable on bare metal |
| Pull-based streaming | Decompress chapters on demand, never hold the whole book in memory |
| Per-chunk compression | lz4, selected per chapter via TOC flag |
| Separately editable tail | META is last: edit title, tags, revision without touching DATA |
| Portable annotations | org.nisoku.anno in EXTRA: highlights, bookmarks, notes travel with the file |
| Search index | SIDX chunk with inverted term index (MessagePack) |
| Encryption envelope | org.nisoku.drm for AES-256-CBC content protection |
| Multi-language metadata | Titles and descriptions localized per BCP 47 language tag |
Quick Start
Rust
use ;
// Zero-copy parse
let data = read.unwrap;
let p = new.unwrap;
println!;
for entry in p.toc_entries
// Streaming read
let file = open.unwrap;
let mut stream = open.unwrap;
for chapter in stream.chapters
// Build
let hzo = new
.add_chunk
.finalize
.unwrap;
TypeScript
import { createReader, buildHonzo } from '@nisoku/honzo';
const response = await fetch('book.hzo');
const buf = new Uint8Array(await response.arrayBuffer());
const reader = await createReader(buf);
console.log(reader.chunkCount, reader.layoutMode);
const meta = reader.getMeta();
console.log(meta.title?.en);
C
HonzoHandle* handle = ;
uint32_t count = ;
Repository Layout
Honzo/
Cargo.toml # Rust workspace root
Build/
crates/
honzo-core/ # no_std wire-format + parser
honzo-chunks/ # chunk semantics (SIDX, COVT, extras)
honzo-io/ # builder/reader/stream + compression (std)
honzo-convert/ # epub/mobi/pdf import
honzo-c/ # C FFI bindings (Diplomat)
honzo-wasm/ # wasm-pack target
honzo-cli/ # CLI binary
adapters/typescript/ # npm @nisoku/honzo
Demo/ # Vite web demo
Docs/ # Documentation site
Tests/
fixtures/ # Sample .hzo files
corpus/ # Edge case files
tests/ # Rust integration tests
honzo.ksy # Kaitai Struct spec
Documentation
Contributing
See CONTRIBUTING.md.
License
Apache License 2.0. See LICENSE.