pub fn hex_to_half_byte(c: u8) -> Result<u8, Error> {
    if c >= b'0' && c <= b'9' {
        Ok(c - b'0')
    } else if c >= b'A' && c <= b'F' {
        Ok(c - b'A' + 0xA)
    } else {
        Err(Error::BadChar)
    }
}
/// Convert a hex character to a nibble
Convert a hex character to a nibble
Convert a hex character to a nibble
pub fn hex_to_half_byte(c: u8) -> Result<u8, Error> {
    if c >= b'0' && c <= b'9' {
        Ok(c - b'0')
    } else if c >= b'A' && c <= b'F' {
        Ok(c - b'A' + 0xA)
    } else {
        Err(Error::BadChar)
    }
}
pub fn hex_to_half_byte ( c : u8 ) -> Result < u8 , Error > { if c >= b'0' && c <= b'9' { Ok ( c - b'0' ) } else if c >= b'A' && c <= b'F' { Ok ( c - b'A' + 0xA ) } else { Err ( Error :: BadChar ) } }
Convert a hex character to a nibble
Convert a hex character to a nibble
c
u8
c
u8