Function array_bytes::hex2bytes[][src]

pub fn hex2bytes(hex: impl AsRef<str>) -> ArrayBytesResult<Bytes>

Hex to Bytes

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

Examples

assert_eq!(
	array_bytes::hex2bytes("0x49204c6f766520596f75").unwrap(),
	b"I Love You".to_vec()
);