light-id 0.1.0

Generate and manipulate incremental IDs effortlessly
Documentation
  • Coverage
  • 83.87%
    26 out of 31 items documented26 out of 28 items with examples
  • Size
  • Source code size: 43.65 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.96 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • lutrinos/Light-id
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ntillier

Crates.io GitHub Documentation

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.

Features

  • Incremental Generation: Easily generate IDs in an incremental fashion.
  • Base Switching: Seamlessly switch between different bases for your IDs.
  • Customization: Fine-tune your IDs with a range of utilities for flexibility.

Links

Getting Started

Installation

Add the following lines to your Cargo.toml file:

[dependencies]

light-id = "0.1.0"

Usage

use light_id::LightId;

let mut generator = LightId::new();
println!("Current ID: {}", generator.next());

Custom base and skipping

use light_id::LightId;

let mut generator = LightId::from("abc");
generator.skip(2);
println!("Skipped ID: {}", generator.current());

Base switching

use light_id::IdSwitcher;

let switcher = IdSwitcher::new("0123456789", "abcdef");
let switched_id = switcher.switch("2");
println!("Switched ID: {}", switched_id);

Support

If you encounter any issues, please report them on GitHub. I'll be pleased to help you!

License

This crate is licensed under the MIT License.