Module utils

Source
Expand description

Various utility functions.

Structs§

Nil
A Nil SMT node.

Functions§

bytes_to_usize
Reads byte_num bytes from bytes slice starting at begin index and interprets them as a usize in little-ending byte order.
generate_sorted_index_value_pairs
Generates a set of random pairs of tree indexes and values. The function intended for use in testing and benchmarking code.
print_output
Prints out the structure of the provided tree, which makes it visually easy to see the placement of leaf, padding, and internal nodes.
set_pos_bestDeprecated
set_pos_worstDeprecated
tree_index_from_u64
Convert a u64 to TreeIndex.
usize_to_bytes
Converts the provided num into the specified number of bytes in little-endian byte order.