:mouse2: mini_uuid
mini_uuid is a Rust crate that converts UUIDs to a compact base64 representation, making them shorter and more efficient for storage and transmission!
P.S, I made this in my free time for fun when I was bored one day, not sure how much I will iterate this, please don't use in production unless you know the code you are using
Features
You can use this crate with v1, v4, or v7 uuids. Padding is optional, with the padding feature and you can enable url safety with the url_safe feature.
Usage
use MiniUuid;
Methods
// Creates a `MiniUuid` from a `uuid::Uuid`
let mini = from_uuid;
// Creates a `MiniUuid` from a string representing `uuid::Uuid`
let mini = from_uuid_str;
// Creates a `MiniUuid` from a string by checking the `padding` and `url_safe` features
let mini = from_string;
// Creates a `MiniUuid` from a url safe base64 string with padding
let mini = from_url_base64;
// Creates a `MiniUuid` from a url safe base64 string without padding
let mini = from_url_base64_no_pad;
// Creates a `MiniUuid` from a base64 string with padding
let mini = from_base64;
// Creates a `MiniUuid` from a base64 string without padding
let mini = from_base64_no_pad;
// Converts `MiniUuid` to `uuid::Uuid`
let uuid = mini.to_uuid;
// Converts `MiniUuid` to a string by checking the `padding` and `url_safe` features
let uuid = mini.to_string;
// Converts `MiniUuid` to url safe base64 string with padding
let uuid = mini.to_url_base64;
// Converts `MiniUuid` to url safe base64 string without padding
let uuid = mini.to_url_base64_no_pad;
// Converts `MiniUuid` to base64 string with padding
let uuid = mini.to_base64;
// Converts `MiniUuid` to base64 string without padding
let uuid = mini.to_base64_no_pad;
Installation
Add mini_uuid to your Cargo.toml:
[]
= "0.2.0"
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments
Inspired by uuid crate and short_uuid crate
Made with :heart: by nanokeshtw