Fast, strict RFC 4648 Base16, Base32, and Base64 codecs for Rust.
Bases supports allocation-free caller buffers, owned results, incremental streaming, formatting, and Serde integration. It works in no_std without dependencies by default.
use bases::{Base64, Base64UrlUnpadded};
let mut buffer = [0_u8; 16];
let encoded = Base64::encode_into(b"hello", &mut buffer).unwrap();
assert_eq!(encoded, "aGVsbG8=");
let encoded = Base64UrlUnpadded::encode_into(b"hello", &mut buffer).unwrap();
assert_eq!(encoded, "aGVsbG8");Add bases = "0.1" to your dependencies. The usage guide covers profiles, feature flags, streaming, and error handling.
| Task | Read |
|---|---|
| Choose a profile or API | Usage guide |
| Look up public contracts | API reference |
| Run application examples | Examples |
| Understand the implementation | Architecture |
| Measure a workload | Benchmarks |
| Review release changes | Changelog |
The workspace separates the library, examples, integration tests, benchmarks, and repository tooling. Run checks from the repository root:
cargo x check
cargo x test
cargo x lintUse cargo x bench for performance comparisons and see the benchmark guide for workloads and measurement limits. See Releasing Bases for release validation and publication.
This crate is built against the latest stable release, and its minimum supported rustc version is 1.88.0.
The policy is that the minimum Rust version required to use this crate can be increased in minor version updates. For example, if Bases 1.0 requires Rust 1.20.0, then Bases 1.0.z for all values of z will also require Rust 1.20.0 or newer. However, Bases 1.y for y > 0 may require a newer minimum version of Rust.
This project is licensed under Apache License, Version 2.0.