tpt-zero-bytes
RustZero-dependency, zero-heap-allocation no_std Rust crates for encoding (base64/hex/varint/endian), integrity checking (CRC/checksums), hashing (FNV/SipHash/xxHash/Murmur), bit manipulation (bitset/bitfield/bloom), and identifiers (UUID/MAC/IP/CIDR).
Languages
tpt-zero-bytes
The foundational layer: pure core, zero allocation, maximum speed.
23 independent, #![no_std], zero-heap-allocation, zero-external-dependency
crates for byte-level encoding, integrity checking, hashing, bit manipulation,
and simple identifier/network types — for bare-metal embedded systems,
bootloaders, and strict WASM environments where alloc isn't available and
every CPU cycle matters.
Every crate here is independently cargo add-able: pulling in CRC32 support
never drags in the hashing crates, the UUID crate, or anything else. No crate
in this workspace depends on another.
Quick start
Add a published crate to your no_std project:
cargo add tpt-zero-bloom
#![no_std]
use tpt_zero_bloom::Bloom;
let mut filter = Bloom::<1024, 4>::new();
filter.insert(b"apple");
assert!(filter.contains(b"apple"));
At a glance — published crates
| Crate | Differentiator (vs the incumbent) | One-liner |
|---|---|---|
tpt-zero-bloom | bloomfilter/fastbloom need alloc; this is stack-only & const-sized | Probabilistic set membership with no heap |
tpt-zero-bitset | bitvec/fixedbitset are heap-backed; this is no_std zero-dep | Fixed-size BitSet<N> alternative |
tpt-zero-mem | zeroize pulls a proc-macro crate; this is one tiny primitive | Volatile secure zeroing |
tpt-zero-base85 | base85/ascii85 are String/Vec-only; this writes into your buffer | Z85 into caller buffers |
tpt-zero-cidr | ipnet/cidr build on std::net::IpAddr; this is pure core | CIDR arithmetic, no std |
tpt-zero-checkdigit | luhn/luhn3 are single-purpose; this bundles the family | Luhn/ISBN/EAN/ISO 7064 |
Crates
The tpt-zero-* prefix marks the crates actually published to crates.io —
each has a real differentiator no mature incumbent covers in no_std /
no-alloc form. The out-zero-* prefix marks crates that stay
workspace-internal only: they duplicate a mature incumbent (or are largely
covered by core itself) and are not published.
Published (tpt-zero-*)
| Crate | Purpose |
|---|---|
tpt-zero-bloom | Fixed-size Bloom filter for probabilistic set membership |
tpt-zero-bitset | Fixed-size, const-generic bit array; zero-dep no_std alternative to heap-backed bitvec/fixedbitset |
tpt-zero-mem | Safe, no_std memory utilities including secure (non-elidable) zeroing |
tpt-zero-base85 | Z85 (ZeroMQ RFC 32) Base85 encoding/decoding into caller buffers |
tpt-zero-cidr | Pure-core IPv4/IPv6 CIDR and subnet arithmetic (no std::net) |
tpt-zero-checkdigit | Luhn, ISBN-10/13/EAN/UPC-A, ISO 7064 MOD 11-2/37-2 check digits |
Internal only (out-zero-*)
| Crate | Purpose |
|---|---|
out-zero-base64 | Standard and URL-safe Base64 encoding/decoding using lookup tables |
out-zero-hex | Blazing-fast, zero-allocation hexadecimal encoding and decoding |
out-zero-endian | Zero-cost, const-evaluable byte-order (endianness) conversion |
out-zero-varint | Variable-length integer (LEB128) encoding for compact payloads |
out-zero-crc | CRC8, CRC16, and CRC32 calculations for data integrity |
out-zero-checksum | Adler-32 and Fletcher checksums |
out-zero-fnv | FNV-1a hashing, optimized for no_std hash maps |
out-zero-siphash | SipHash-1-3 and SipHash-2-4 for HashDoS resistance |
out-zero-murmur | MurmurHash3 for general non-cryptographic hashing |
out-zero-xxhash | Pure Rust XXH32/XXH64 implementation |
out-zero-cobs | Consistent Overhead Byte Stuffing for reliable embedded serial comms |
out-zero-bitfield | Compile-time or runtime safe bitfield accessors |
out-zero-bytes | Safe byte slice manipulation utilities (split, copy, compare, find) |
out-zero-uuid | UUID generation and parsing via pure math |
out-zero-mac | MAC address parsing and formatting |
out-zero-ip | IPv4/IPv6 address parsing and manipulation, pure core |
out-zero-compact | Compact integer encoding for network payloads (SCALE-style) |
Design
#![no_std], noalloc. Every crate builds againstcorealone — verified in CI by cross-compiling tothumbv6m-none-eabi(bare Cortex-M0, no std, no allocator) andwasm32-unknown-unknown.- Zero external dependencies.
[workspace.dependencies]is intentionally empty.dev-dependencies(proptest,criterion) exist only for tests and benchmarks — they never ship in a published crate. - No cross-crate dependencies. Each crate is a standalone leaf; adopt one without pulling in the rest of the ecosystem.
#![forbid(unsafe_code)]in every crate excepttpt-zero-mem, which needs one documentedunsafeblock for a volatile zeroing write that the optimizer cannot elide.
See spec.txt for the full ecosystem design doc and
TODO.md for the phased implementation roadmap.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.