Module hex_conservative::serde
source · Available on crate feature
serde
only.Expand description
Hex encoding with serde
.
The functions in this module de/serialize as hex only when the serializer is human readable.
§Examples
use hex_conservative as hex;
use serde::{Serialize, Deserialize};
#[derive(Debug, Serialize, Deserialize)]
struct Foo {
#[serde(with = "hex::serde")]
bar: Vec<u8>,
}
Functions§
- Deserializes a hex string into raw bytes.
- Serializes
data
as a hex string using lowercase characters. - Serializes
data
as a hex string using lowercase characters. - Serializes
data
as hex string using uppercase characters.