Function decode_hex

Source
pub fn decode_hex(s: &str) -> Result<Vec<u8>>
Expand description

Decode a hex string to a byte vector.

§Example

use backup_deduplicator::utils::decode_hex;
 
let bytes = decode_hex("deadbeef").unwrap();
assert_eq!(bytes, vec![0xde, 0xad, 0xbe, 0xef]);

§Errors

Returns an error if the given string is not a valid hex string.