Honzo
A binary ebook format for simplicity, performance, and portability.
Zero CopyStreaming
Portable
Quick Start GitHub
Existing ebook formats are designed for authoring, not consumption. XML parsing, incremental loading, and memory waste on the reader’s device.
Honzo flips this. Optimized for reading, not writing.
Features
Parse without allocating. Memory map the file and read directly from the buffer. This works on bare metal.
Decompress chapters on demand. Never hold the whole book in memory. Open a 2GB book with zero heap allocation until you turn a page.
Each TOC entry selects its compression algorithm independently. Chapters with text compress well. Images and fonts stay raw.
META sits at the end of the file. Edit the title, tags, or revision without touching the data section.
Highlights, bookmarks, and notes stored as EXTRA entries under org.nisoku.anno. They travel with the file and survive reconversion.
AES-256-GCM content protection via org.nisoku.drm. ECDH key exchange with X25519. Per recipient wrapping.
Quick Example
use honzo_core::HonzoParser;
let data = std::fs::read("book.hzo").unwrap();
let p = HonzoParser::new(&data, 1).unwrap();
println!("{} chunks", p.head().chunk_count);
for entry in p.toc_entries() {
println!(" {} - {:?}", entry.chunk_id, std::str::from_utf8(&entry.chunk_type));
}
import { createReader } from "@nisoku/honzo";
const response = await fetch("book.hzo");
const buf = new Uint8Array(await response.arrayBuffer());
const reader = await createReader(buf);
const meta = reader.getMeta();
console.log(meta.title?.en);
#include "honzo.h"
HonzoHandle* handle = HonzoHandle_parse(data, data_len, 1);
uint32_t count = HonzoHandle_chunk_count(handle);
Installation
[dependencies]
honzo-io = "0.1"
npm install @nisoku/honzo
#include "honzo.h"
// link libhonzo_c.a
cargo install honzo-cli