Skip to main content

Module hex

Module hex 

Source
Expand description

Hex encoding of bytes and integers.

encode_bytes and encode_bytes_into encode a byte slice into an owned String or an appended Vec<u8>, respectively; encode_bytes_to_slice writes into a caller-provided, pre-sized buffer. encode_u64 encodes an integer, trimming leading zeros. All four take a HexCase to choose between lowercase and uppercase digits.

Enums§

HexCase
Case of the emitted hex digits.

Traits§

ToHex
Trait for converting integer types to hexadecimal in a buffer

Functions§

encode_bytes
Returns the hex encoding of bytes as an owned String.
encode_bytes_into
Appends the hex encoding of bytes to out.
encode_bytes_to_slice
Writes the hex encoding of bytes into out.
encode_u64
Writes v as hex into buf and returns the written subslice.