Module utils

Module utils 

Source
Expand description

Utilities used in this crate which can also be generally useful downstream.

Structs§

ReadAdapter
An adapter of ByteReader to any type that implements std::io::Read
SliceReader
Implements ByteReader trait for a slice of bytes.

Enums§

DeserializationError
Defines errors which can occur during deserialization.
HexParseError
Defines errors which can occur during parsing of hexadecimal strings.

Traits§

ByteReader
Defines how primitive values are to be read from Self.
ByteWriter
Defines how primitive values are to be written into Self.
Deserializable
Defines how to deserialize Self from bytes.
Serializable
Defines how to serialize Self into bytes.

Functions§

bytes_to_elements_exact
Converts bytes to field elements with validation.
bytes_to_elements_with_padding
Converts a sequence of bytes into vector field elements with padding. This guarantees that no two sequences or bytes map to the same sequence of field elements.
bytes_to_hex_string
Renders an array of bytes as hex into a String.
bytes_to_packed_u32_elements
Converts bytes to field elements using u32 packing in little-endian format.
elements_to_bytes
Converts field elements to raw byte representation.
hex_to_bytes
Parses a hex string into an array of bytes of known size.
padded_elements_to_bytes
Converts a sequence of padded field elements back to the original bytes.
uninit_vector
Returns a vector of the specified length with un-initialized memory.
word_to_hex
Converts a Word into hex.