Function dusk_bytes::hex [−][src]
pub const fn hex<const N: usize, const M: usize>(bytes: &[u8; N]) -> [u8; M]
Expand description
A constant funtion to parse a bytes string representing hexadecimals
(e.g. b"fe12c6"
) into bytes (e.g [0xfe, 0x12, 0xc6]
).
If a smaller destination buffer is provided, the value will be truncated
(e.g [0xfe, 0x12]
); if a bigger destination buffer is provided, it will
be padded with zeroes (e.g. `[0xfe, 0x12, 0xc6, 0x0, 0x0])
If an invalid character is given, it will panic at compile time.