https://github.com/itpey/shinyid-rs
high-performance Rust package inspired by Instagram's shortcode system for encoding and decoding unique identifiers into URL-safe 'shiny'
https://github.com/itpey/shinyid-rs
api base64 decoding encoding facebook-api instagram instagram-api instagram-private-api meta meta-api rust rust-lang shortcode snowflake threads threads-api threads-app ulid uuid
Last synced: 7 months ago
JSON representation
high-performance Rust package inspired by Instagram's shortcode system for encoding and decoding unique identifiers into URL-safe 'shiny'
- Host: GitHub
- URL: https://github.com/itpey/shinyid-rs
- Owner: itpey
- License: apache-2.0
- Created: 2024-03-13T21:42:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-17T02:32:09.000Z (over 1 year ago)
- Last Synced: 2024-04-14T12:21:51.369Z (over 1 year ago)
- Topics: api, base64, decoding, encoding, facebook-api, instagram, instagram-api, instagram-private-api, meta, meta-api, rust, rust-lang, shortcode, snowflake, threads, threads-api, threads-app, ulid, uuid
- Language: Rust
- Homepage: https://crates.io/crates/shinyid
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ShinyID
[](https://crates.io/crates/shinyid)
[](https://docs.rs/shinyid)## About
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.
## Table of Contents
- [ShinyID](#shinyid)
- [About](#about)
- [Table of Contents](#table-of-contents)
- [Features](#features)
- [Installation](#installation)
- [Example](#example)
- [License](#license)
- [Author](#author)## Features
- **Efficient Encoding :** ShinyID offers a highly efficient method for converting numeric IDs into shiny strings.
- **Lightning-Fast Decoding :** Decoding shiny strings into their original numeric IDs is optimized for speed and performance.
- **URL-Safe :** Shiny strings are designed to be URL-safe, making them suitable for web applications.
- **Inspired by Instagram :** The package draws inspiration from Instagram's shortcode system, ensuring a familiar and intuitive approach to representing IDs.## Installation
Add the following line to your `Cargo.toml` file:
```toml
[dependencies]
shinyid = "0.2.0"
```## Example
Here's a simple example showcasing the use of ShinyID:
```rust
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),
}
}```
## License
This package is distributed under the Apache License, Version 2.0. See the [LICENSE](https://github.com/itpey/shinyid-rs/blob/main/LICENSE) file for more details.
## Author
ShinyID was created by [itpey](https://github.com/itpey).