Skip to main content

parse_byte

Function parse_byte 

Source
pub const fn parse_byte([h, l]: [u8; 2]) -> Result<u8>
Expand description

Parses two hex characters into a byte.

ยงExamples

use omp_core::hex::parse_byte;
assert_eq!(parse_byte([b'4', b'8']).unwrap(), 0x48);
assert_eq!(parse_byte([b'f', b'f']).unwrap(), 0xff);