Thanks to visit codestin.com
Credit goes to docs.rs

Skip to main content

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"

Re-exports§

pub use crate::serde::deserialize;serde
pub use crate::serde::serialize;alloc and serde
pub use crate::serde::serialize_upper;alloc and serde

Modules§

serdeserde
Hex encoding with serde.

Enums§

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

Traits§

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

Functions§

decodealloc
Decodes a hex string into raw bytes.
decode_to_slice
Decode a hex string into a mutable bytes slice.
encodealloc
Encodes data as hex string using lowercase characters.
encode_to_slice
Encodes some bytes into a mutable slice of bytes.
encode_upperalloc
Encodes data as hex string using uppercase characters.