Crates.io | puid |
lib.rs | puid |
version | 0.2.0 |
source | src |
created_at | 2022-05-02 12:30:53.709252 |
updated_at | 2023-02-04 11:55:33.451211 |
description | A unique ID generator with 'ch_'-style prefix |
homepage | https://github.com/aitorfernandez/puid |
repository | https://github.com/aitorfernandez/puid.git |
max_upload_size | |
id | 579071 |
size | 13,502 |
A unique ID generator using a given prefix with ch_
-style.
The ID is a composition of:
use puid::puid;
fn main() {
let id = Puid::builder().prefix("foo").unwrap().build().unwrap(); // foo_l2ok01bl0yq2i2ElC7zWaCR8
}
use puid::puid;
fn main() {
let id = Puid::builder().prefix("bar").unwrap().entropy(24).build().unwrap(); // bar_l2ok1yvk1z4aOz1P7kecCTaqUGq1wgKfHGZC
}