base16 0.1.1

base16 (hex) encoding and decoding
Documentation

base16 (hex) encoding for Rust.

Docs

This is a base16 (e.g. hexadecimal) encoding and decoding library with an emphasis on performance. At the time of this writing, it's faster than the competitors that I could find.

Usage

Add base16 = "0.1" to Cargo.toml, then:

extern crate base16;

fn main() {
    let original_msg = "Foobar";
    let hex_string = base16::encode_lower(original_msg);
    assert_eq!(hex_string, "466f6f626172");
    let decoded = base16::decode(&hex_string).unwrap();
    assert_eq!(String::from_utf8(decoded).unwrap(), original_msg);
}

More usage examples in the docs (every function should have a usage example now).

License

Dual MIT/Apache2 (whichever you prefer) since that seems hip for Rust code.