Crates.io | akai |
lib.rs | akai |
version | 0.1.1 |
source | src |
created_at | 2024-01-05 23:22:27.870299 |
updated_at | 2024-01-05 23:26:21.244228 |
description | Next-generation, functional and simple ID system |
homepage | |
repository | |
max_upload_size | |
id | 1090598 |
size | 18,592 |
A next-generation, customizable and simple ID system, built in Rust.
Put the desired version of the crate into the dependencies section of your Cargo.toml:
[dependencies]
akai = { version = "0.1.0" }
Akai IDs consist of 3 sections: the prefix, the Superflake and the tail, which is simply a cryptographically secure random string.
Superflake is a revolutionary identification technology based on Twitter's Snowflake. Superflake is generated by concatenating:
use akai::{Akai, AkaiPrefix, AkaiOptions};
let prefix = AkaiPrefix {
content: "user".to_string(),
allows_lowercase: true
};
let akai = Akai::new(AkaiOptions {
prefix,
custom_bytes: Some(8),
custom_timestamp: None
});
match akai.generate() {
Ok(id) => println!("{}", id),
Err(error) => eprintln!("Error: {}", error)
}