Crate hex
Encoding and decoding hex strings.
For most cases, you can simply use the decode, encode and
encode_upper functions. If you need a bit more control, use the traits
ToHex and FromHex instead.
Example
#
# let mut output = ;
#
#
# encode_to_slice.unwrap;
#
#
# let hex_string = from_utf8.unwrap;
#
#
let hex_string = encode;
println!; // Prints "48656c6c6f20776f726c6421"
# assert_eq!;
Modules
-
serde
Hex encoding with
serde.
Enums
-
FromHexError
The error type for decoding a hex string into
Vec<u8>or[u8; N].
Traits
Functions
- decode Decodes a hex string into raw bytes.
- decode_to_slice Decode a hex string into a mutable bytes slice.
- deserialize Deserializes a hex string into raw bytes.
-
encode
Encodes
dataas hex string using lowercase characters. - encode_to_slice Encodes some bytes into a mutable slice of bytes.
-
encode_upper
Encodes
dataas hex string using uppercase characters. -
serialize
Serializes
dataas hex string using lowercase characters. -
serialize_upper
Serializes
dataas hex string using uppercase characters.