Function array_bytes::hex2bytes

source ·
pub fn hex2bytes(hex: &str) -> ArrayBytesResult<Bytes>
Expand description

Hex to Bytes.

Return error while length is an odd number or any byte out of radix.

Examples

assert_eq!(
	array_bytes::hex2bytes("0x4c6f7665204a616e6520466f7265766572"),
	Ok(b"Love Jane Forever".to_vec())
);