[][src]Function hex_string::hexchar_to_nibble

pub fn hexchar_to_nibble(c: &char) -> Result<u8, HexStringError>

Given a character, convert it into a u8 in the range 0-15 (inclusive).

Note that Rust does not have an obvious nibble data type, so we approximate with the lower 4 bits of a u8.

This will raise InvalidCharacte if the provided character is not in the range 0-9 or a-f (lower-case only).