Honzo

A binary ebook format for simplicity, performance, and portability.

Zero Copy
Streaming
Portable

Quick Start GitHub
Why Honzo?

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

Zero Copy Parsing

Parse without allocating. Memory map the file and read directly from the buffer. This works on bare metal.

Pull Based Streaming

Decompress chapters on demand. Never hold the whole book in memory. Open a 2GB book with zero heap allocation until you turn a page.

Per Chunk Compression

Each TOC entry selects its compression algorithm independently. Chapters with text compress well. Images and fonts stay raw.

Tail Mutability

META sits at the end of the file. Edit the title, tags, or revision without touching the data section.

Portable Annotations

Highlights, bookmarks, and notes stored as EXTRA entries under org.nisoku.anno. They travel with the file and survive reconversion.

Encryption Envelope

AES-256-GCM content protection via org.nisoku.drm. ECDH key exchange with X25519. Per recipient wrapping.

Quick Example

Rust
TypeScript
C
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

Rust
TypeScript
C
CLI
[dependencies]
honzo-io = "0.1"
npm install @nisoku/honzo
#include "honzo.h"
// link libhonzo_c.a
cargo install honzo-cli

Next Steps

Getting Started

Start here if you are new to Honzo.

Quick Start
Installation

Learn the Format

Understand how Honzo works under the hood.

Core Concepts
Wire Format

Reference

Browse the full API and CLI documentation.

CLI Reference
API Reference