1 unstable release
Uses new Rust 2024
| 0.1.0 | Oct 28, 2025 |
|---|
#7 in #u64
Used in 3 crates
8KB
117 lines
π² NetId64
A prototype type for precise and elegant 64-bit network identity.
NetId64 is a minimal, no-std-friendly Rust crate that defines a
64-bit deterministic network identifier:
[KIND:8][NODE:16][COUNTER:40]
Each bit has a purpose:
- KIND (8 bits) β logical entity type (user, message, node, etc.)
- NODE (16 bits) β origin node / partition
- COUNTER (40 bits) β local monotonic counter
π§© Philosophy
This crate is part of a broader prototype of an idea:
transport-safe identity.
Not random, not opaque, but shaped by its place in the network.Itβs not yet another UUID β itβs a deterministic, modular identity that can live across QUIC frames, caches, or async boundaries.
Think of it as the prototype species of a coming type family:
NetId64 β NetIdUuid β NetIdSnowflake β all share the same wire semantics.
β³οΈ Features
no_stdcompatible- optional
serdesupport - constant-time encode/decode (
u64big-endian) Display/FromStrfor human-friendly forms ("1:42:999"or"0x01AA00F3...")
βοΈ Example
use netid64::NetId64;
let id = NetId64::make(1, 7, 42);
println!("{}", id); // 1:7:42
assert_eq!(id.node(), 7);
assert_eq!(id.counter(), 42);
π Manifesto
This crate carries no grand promise β only a direction:
to design identities that serve life, not ownership.
Everything is for life.
And if identity is a certificate,
let it be the most widely authorized one β
granted by existence itself.
Dependencies
~165KB