Crates.io | shinyid |
lib.rs | shinyid |
version | 0.2.0 |
source | src |
created_at | 2024-03-13 22:59:33.048777 |
updated_at | 2024-03-14 05:31:07.769489 |
description | A package for encoding and decoding unique identifiers into URL-safe ( shiny ) |
homepage | |
repository | https://github.com/itpey/shinyid-rs |
max_upload_size | |
id | 1172645 |
size | 19,098 |
ShinyID is a high-performance Rust package inspired by the Instagram shortcode system. It allows you to encode and decode unique identifiers (IDs) into a human-readable and URL-safe string format called 'shiny'. This package is designed for scenarios where speed and efficiency are crucial, making it ideal for applications that need to handle large volumes of encoded IDs.
Add the following line to your Cargo.toml
file:
[dependencies]
shinyid = "0.1.0"
Here's a simple example showcasing the use of ShinyID:
use shinyid::{to_id, to_shiny};
fn main() {
let id = 18446744073709551615;
let shiny = to_shiny(id);
println!("Shiny representation of {} is {}", id, shiny);
let shiny = "P__________";
match to_id(shiny) {
Ok(id) => println!("ID corresponding to {} is {}", shiny, id),
Err(err) => eprintln!("Error: {}", err),
}
}
This package is distributed under the Apache License, Version 2.0. See the LICENSE file for more details.
ShinyID was created by itpey.