Globally unique sortable id generator. A Rust port of https://github.com/rs/xid.
MIT License
Globally unique sortable id generator. A Rust port of https://github.com/rs/xid.
The binary representation is compatible with the Mongo DB 12-byte ObjectId. The value consists of:
The string representation is 20 bytes, using a base32 hex variant with characters [0-9a-v]
to retain the sortable property of the id.
See the original xid
project for more details.
println!("{}", xid::new()); //=> bva9lbqn1bt68k8mj62g
cargo run --example gen
: Generate xid