pub fn from_hex(hex_str: String) -> Result<Vec<u8>, num::ParseIntError> {
	let hex_trim = if &hex_str[..2] == "0x" {
		hex_str[2..].to_owned()
	} else {
		hex_str.clone()
	};
	split_n(&hex_trim.trim()[..], 2)
		.iter()
		.map(|b| u8::from_str_radix(b, 16))
		.collect::<Result<Vec<u8>, _>>()
}
/// Decode a hex string into bytes.
Decode a hex string into bytes.
Decode a hex string into bytes .
pub fn from_hex(hex_str: String) -> Result<Vec<u8>, num::ParseIntError> {
	let hex_trim = if &hex_str[..2] == "0x" {
		hex_str[2..].to_owned()
	} else {
		hex_str.clone()
	};
	split_n(&hex_trim.trim()[..], 2)
		.iter()
		.map(|b| u8::from_str_radix(b, 16))
		.collect::<Result<Vec<u8>, _>>()
}
pub fn from_hex ( hex_str : String ) -> Result < Vec < u8 > , num :: ParseIntError > { let hex_trim = if & hex_str [ .. 2 ] == " " { hex_str [ 2 .. ] . to_owned ( ) } else { hex_str . clone ( ) } ; split_n ( & hex_trim . trim ( ) [ .. ] , 2 ) . iter ( ) . map ( | b | u8 :: from_str_radix ( b , 16 ) ) . collect :: < Result < Vec < u8 > , _ > > ( ) }
Decode a hex string into bytes.
Decode a hex string into bytes .
hex_str
String