rust-base62 0.2.0

A simple library base62 encode/decode, no dependencies other libraries.
Documentation
  • Coverage
  • 50%
    3 out of 6 items documented0 out of 3 items with examples
  • Size
  • Source code size: 45.65 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.41 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • hongweipeng/rust-base62
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • hongweipeng

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())
}