rust-base62

Crates.iorust-base62
lib.rsrust-base62
version0.2.0
sourcesrc
created_at2024-11-07 11:16:51.33532
updated_at2024-11-15 06:47:49.277283
descriptionA simple library base62 encode/decode, no dependencies other libraries.
homepagehttps://github.com/hongweipeng/rust-base62
repositoryhttps://github.com/hongweipeng/rust-base62
max_upload_size
id1439683
size45,967
Weipeng Hong (hongweipeng)

documentation

https://github.com/hongweipeng/rust-base62

README

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())
}
Commit count: 7

cargo fmt