base62num 0.1.1

A convertor between numbers and strings in Base62.
Documentation
  • Coverage
  • 100%
    6 out of 6 items documented5 out of 6 items with examples
  • Size
  • Source code size: 8.75 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 325.26 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • jtr109/base62num
    1 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jtr109

base62num

Crates.io License Coverage Status

A convertor between numbers and strings in Base62.

Alphanumeric

This library using the Base62 index table on Wikipedia, which is in the order of "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" that familiar with Base64.

Usages

Using the crate as a dependency.

[dependencies]
base62num = "0.1"

Encoding A Number into A String in Base62

use base62num::encode;

assert_eq!(encode(123), "B9");

Decoding A String in Base62 into A Number

use base62num::decode;

assert_eq!(decode("B9"), Some(123));

License

base62num is under the MIT license.