| Crates.io | uuid-extra |
| lib.rs | uuid-extra |
| version | 0.0.2 |
| created_at | 2025-05-29 23:44:01.730813+00 |
| updated_at | 2025-06-29 00:19:48.225232+00 |
| description | Minimalist UUID extra utilities for base encoding UUIDs (base64 and base58) |
| homepage | https://github.com/jeremychone/rust-uuid-extra |
| repository | https://github.com/jeremychone/rust-uuid-extra |
| max_upload_size | |
| id | 1694525 |
| size | 52,501 |
Minimalist Rust crate providing UUID (v4 and v7) generation with Base58 and Base64 (standard, URL-safe, URL-safe no-pad) encoding helpers.
Designed for simplicity and ease of use when you need encoded UUIDs without much fuss.
Add to your Cargo.toml:
[dependencies]
uuid-extra = "0.0.1" # Replace with the latest version
use uuid_extra::new_v7_b58;
fn main() {
let b58_uuid = new_v7_b58();
println!("Base58 UUID v7: {}", b58_uuid);
// Example output: B1ZwvMXbQ2iQjJWC9vA7Tf
}
use uuid_extra::new_v7_b64url_nopad;
fn main() {
let b64url_nopad_uuid = new_v7_b64url_nopad();
println!("Base64 URL-safe (no-pad) UUID v7: {}", b64url_nopad_uuid);
// Example output: MDE4Zjc5ZTctN2RhZS03Yj
}
new_v4_b58, new_v7_b58)new_v4_b64, new_v7_b64)new_v4_b64url, new_v7_b64url)new_v4_b64url_nopad, new_v7_b64url_nopad)uuid::Uuid.
from_b58(s: &str) -> Result<Uuid>from_b64(s: &str) -> Result<Uuid>from_b64url(s: &str) -> Result<Uuid>from_b64url_nopad(s: &str) -> Result<Uuid>to_time_epoch_ms(uuid: &Uuid) -> Result<i64>The crate uses a simple Result<T> type alias (crate::Result<T>) with a custom crate::Error enum for error handling. This makes it straightforward to handle potential issues like decoding errors.
For more detailed examples, please check the unit tests within each module (e.g., src/extra_base58.rs, src/extra_base64.rs).
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is licensed under the MIT License.