3 unstable releases
0.2.0 | Nov 15, 2024 |
---|---|
0.1.1 | Nov 8, 2024 |
0.1.0 | Nov 7, 2024 |
#1 in #leading
344 downloads per month
16KB
203 lines
rust-base62
A simple library base62 encode/decode, no dependencies other libraries.
Use big endian and support leading zeros.
Alphabet
It supports the standard [0-9A-Za-z]
: https://en.wikipedia.org/wiki/Base62
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
Example
use rust_base62;
fn main() {
let plaintext = "hello";
let ciphertext = rust_base62::encode(plaintext.as_bytes());
let decode = rust_base62::decode(ciphertext.as_bytes()).unwrap();
println!("cipher text: {}", ciphertext);
println!("decode text: {}", String::from_utf8(decode).unwrap())
}
lib.rs
:
A simple library base62 encode/decode, no dependencies other libraries.