Function base16::encode_byte
[−]
[src]
pub fn encode_byte(byte: u8, cfg: EncConfig) -> (u8, u8)
Encode a single character as hex, returning a tuple containing the two encoded bytes in big-endian order -- the order the characters would be in when written out (e.g. the top nibble is the first item in the tuple)
Example
assert_eq!(base16::encode_byte(0xff, base16::EncodeLower), (b'f', b'f')); assert_eq!(base16::encode_byte(0xa0, base16::EncodeUpper), (b'A', b'0')); assert_eq!(base16::encode_byte(3, base16::EncodeUpper), (b'0', b'3'));