base62num

Crates.iobase62num
lib.rsbase62num
version0.1.1
sourcesrc
created_at2020-09-13 13:52:36.580894
updated_at2020-09-13 14:16:54.735934
descriptionA convertor between numbers and strings in Base62.
homepage
repositoryhttps://github.com/jtr109/base62num
max_upload_size
id288186
size8,752
YuanPei Li (jtr109)

documentation

README

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.

Commit count: 16

cargo fmt