[−][src]Module monotree::utils
A module for implementing some helpful functions for monotree
.
Functions
bit | Get |
bits_to_bytes | Convert bits, Vec slice of |
bits_to_usize | Convert a Vec slice of bit or |
bytes_to_bits | Convert a bytes slice into a Vec of bit. |
bytes_to_int | Convert big-endian bytes into base10 or decimal number. |
bytes_to_slicebit | Convert (bytes slice + Range) representation into bits in forms of |
cast | Cast from a typed scalar to another based on |
get_sorted_indices | Get sorted indices from unsorted slice. |
int_to_bytes | Get a compressed bytes (leading-zero-truncated big-endian bytes) from a |
len_lcp | Get length of the longest common prefix bits for the given two slices. |
nbytes_across | Get the required length of bytes from a |
offsets | Adjust the bytes representation for |
random_byte | Generate a random byte based on |
random_bytes | Generate random bytes of the given length. |
random_hash | Generate a random |
random_hashes | Generate a vector of random |
shuffle | Shuffle a slice using Fisher-Yates algorithm. |
slice_to_hash | Get a fixed lenght byte-array or |