serde_hex::utils

Function fromhex

Source
pub fn fromhex(buf: &mut [u8], src: &[u8]) -> Result<(), ParseHexError>
Expand description

Helper function which takes a mutable slice of expected byte-length and attempts to parse an immutable slice of bytes as hexadecimal characters. Returns an error if src is not exactly twice the size of buf, or if any non-hexadecimal characters are found.