Crates.io | light-id |
lib.rs | light-id |
version | 0.1.0 |
source | src |
created_at | 2023-12-14 19:02:21.4062 |
updated_at | 2023-12-14 19:02:21.4062 |
description | Generate and manipulate incremental IDs effortlessly |
homepage | |
repository | https://github.com/ntillier/Light-id |
max_upload_size | |
id | 1069880 |
size | 44,151 |
light-id
is a Rust crate designed for effortless generation and manipulation of lightweight, incremental IDs. Built with safety and speed in mind, it offers a versatile and customizable approach to create and switch between different bases for IDs. The crate includes various utilities to tailor your IDs to specific requirements.
Add the following lines to your Cargo.toml
file:
[dependencies]
light-id = "0.1.0"
use light_id::LightId;
let mut generator = LightId::new();
println!("Current ID: {}", generator.next());
use light_id::LightId;
let mut generator = LightId::from("abc");
generator.skip(2);
println!("Skipped ID: {}", generator.current());
use light_id::IdSwitcher;
let switcher = IdSwitcher::new("0123456789", "abcdef");
let switched_id = switcher.switch("2");
println!("Switched ID: {}", switched_id);
If you encounter any issues, please report them on GitHub. I'll be pleased to help you!
This crate is licensed under the MIT License.