Crate hex

Crate hex 

Source
Expand description

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 hex_string = hex::encode("Hello world!");

println!("{}", hex_string); // Prints "48656c6c6f20776f726c6421"

Modulesยง

error ๐Ÿ”’

Macrosยง

from_hex_array_impl ๐Ÿ”’

Structsยง

BytesToHexChars ๐Ÿ”’

Enumsยง

FromHexError
The error type for decoding a hex string into Vec<u8> or [u8; N].

Constantsยง

HEX_CHARS_LOWER ๐Ÿ”’
HEX_CHARS_UPPER ๐Ÿ”’

Traitsยง

FromHex
Types that can be decoded from a hex string.
ToHex
Encoding values as hex string.

Functionsยง

byte2hex ๐Ÿ”’
decode
Decodes a hex string into raw bytes.
decode_to_slice
Decode a hex string into a mutable bytes slice.
encode
Encodes data as hex string using lowercase characters.
encode_to_iter ๐Ÿ”’
encode_to_slice
Encodes some bytes into a mutable slice of bytes.
encode_upper
Encodes data as hex string using uppercase characters.
generate_iter ๐Ÿ”’
val ๐Ÿ”’