Utilities for encoding and decoding hex strings.
To encode a &[u8] you can use:
- [
encode] - [
encode_to_vec]
To decode you can use:
- [
decode] for&str - [
decode_from_vec] forVec<u8> - [
FromHex::from_hex] forVec<u8>and someu8array sizes. - [
decode_to_buf] for decoding a&strinto a&mut [u8]with the exact size.
Features
serde
With the serde feature enabled you can use [crate::serde] to serialize any
u8 array or Vec<u8> to hex and deserialize hex string to a Vec<u8> and
a fixed selection of u8 arrays.