Expand description
§Base122-Fast
A high-performance Base122 implementation achieving throughput up to 6.5 Gbps (encoding) and 6.2 Gbps (decoding) on modern hardware (e.g., AMD Ryzen 5 5600, single-threaded).
Base122 is a binary-to-text encoding scheme that is significantly more space-efficient than Base64, offering approximately 14% overhead compared to Base64’s 33%, while remaining valid UTF-8.
§Key Features
- High Throughput: Optimized for Gbps-level processing.
- no_std: Suitable for embedded systems and WASM (requires
alloc). - SIMD Within A Register: Uses SWAR techniques to process multiple bytes in 64-bit registers.
- Safety: While leveraging
unsafefor performance, it is rigorously tested for round-trip integrity.
§Quick Start
let data = b"hello world";
let encoded = base122_fast::encode(data);
let decoded = base122_fast::decode(&encoded).expect("Failed to decode");
assert_eq!(data, decoded.as_slice());