fastbase91
A fast basE91 binary-to-text codec: a
no_std, #![forbid(unsafe_code)] Rust core (fastbase91-core) with a
PyO3-based Python binding (fastbase91).
basE91 packs binary data into 91 printable ASCII characters, giving roughly 23% size overhead — noticeably tighter than base64's ~33%.
Features
- Fast — a tight Rust core; on GIL-enabled CPython, one-shot
encode()/decode()calls with inputs of at least 1 KiB release the GIL so calls can overlap. - Safe —
#![forbid(unsafe_code)]throughout the core. - Portable —
no_stdcore (optionalalloc/std); runs on bare metal. - Streaming — incremental
Encoder/Decoderfor data that does not fit in memory at once. - Free-threaded ready — the Python extension declares
gil_used = falseand ships free-threaded wheels (CPython 3.14t / 3.15t). - Stable-ABI wheels — one abi3 wheel per platform covers GIL-enabled
CPython 3.11+; free-threaded 3.14 has its own wheel, and CPython 3.15+
(regular or free-threaded) can use a combined
abi3/abi3twheel.
Install
Rust:
Python:
Usage
Rust:
use ;
let encoded = encode.unwrap; // -> b"TPwJh>A"
let decoded = decode.unwrap;
assert_eq!;
Python:
= # -> b"TPwJh>A"
assert == b
Documentation
Full documentation (English / 正體中文), including usage, installation and platform compatibility, API reference, free-threading, benchmarks, and a changelog: https://birdhackor.github.io/fastbase91/
Versioning
The Rust core and the Python package are released on two independent version
lines: fastbase91-core on crates.io
via fastbase91-core-vX.Y.Z tags, and fastbase91 wheels on
PyPI via vX.Y.Z tags. See
MAINTENANCE.md
for the release runbook.
License
Licensed under either of MIT or Apache-2.0 at your option.