Crates.io | rsbase62 |
lib.rs | rsbase62 |
version | 0.1.1 |
source | src |
created_at | 2024-07-18 15:02:18.156874 |
updated_at | 2024-07-18 15:25:57.119497 |
description | A high-performance, Rust-optimized Base62 encoding implementation |
homepage | |
repository | https://github.com/aeromilai/rsbase62 |
max_upload_size | |
id | 1307545 |
size | 20,182 |
A high-performance, Rust-optimized Base62 encoding implementation.
The name rsbase62
stands for "Rust Base62", highlighting several key aspects of this crate:
Rust-focused: This implementation is specifically optimized for Rust, taking advantage of Rust's performance characteristics and safety features where possible.
Clarity: The "rs" prefix clearly indicates that this is a Rust implementation, distinguishing it from Base62 libraries in other languages.
Discoverability: The name is easy to search for and remember, making it simple for Rust developers to find and use.
Specificity: It clearly communicates that this crate deals with Base62 encoding, not Base64 or other similar encodings.
Add this to your Cargo.toml
:
[dependencies]
rsbase62 = "0.1.0"
Then, in your Rust code:
use rsbase62::encode;
fn main() {
let num: u128 = 123456789;
let encoded = unsafe { encode(num) };
println!("Encoded: {}", encoded);
}
This crate uses unsafe
code for performance optimization. It is the caller's responsibility to ensure that:
For safe usage, consider wrapping the encode
function in a safe API in your own code.
Benchmarks comparing this implementation to other Base62 crates are included. Run them with:
cargo bench
This project is licensed under
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.