email_encoding/headers/
hex.rs

1const HEX_CHARS: &[u8; 16] = b"0123456789ABCDEF";
2
3pub(super) const fn encode_byte(byte: u8) -> [u8; 2] {
4    [lower_nibble_to_hex(byte >> 4), lower_nibble_to_hex(byte)]
5}
6
7const fn lower_nibble_to_hex(half_byte: u8) -> u8 {
8    HEX_CHARS[(half_byte & 0x0F) as usize]
9}