merkel v1.0.3 Merkel.BinaryHashTree
Implements a merkle binary hash tree that is balanced using AVL rotations
Supports create, lookup, keys, insert, delete operations
Given an initial list of k-v pairs constructs an initial balanced tree without any initial rotations or initial rehashings
Keys are binary, e.g. a utf8 encoded sequence of bytes (string) or just bytes Values are any type (use your discretion if you want the tree to be more compact)
Keys and values are only stored in the leaves Inner nodes use the search_key value to determine order
Hashes of the keys are stored in the node key_hash field Inner nodes store the concatenated hashes of their children in key_hash as well
Link to this section Summary
Functions
Create balanced tree given a list of {k,v} pairs or create empty tree
Delete the specified key, ensuring it resides in the tree. Updates binary tree search keys
Convert tree to erlang term format
Provides dump of tree info to be used in Inspect protocol implementation
Adds key value pair and then ensures tree is balanced
Returns list of keys from bottom left of tree to bottom right
Returns key value pair if key lookup is successful
Store tree to file path p, in erlang term format
Link to this section Types
Link to this section Functions
Create balanced tree given a list of {k,v} pairs or create empty tree
Given a list of atom key and binary value pairs, the atom options are :etf and :path to support creation from either a merkel etf binary or a file containing a merkel etf binary
Delete the specified key, ensuring it resides in the tree. Updates binary tree search keys
Convert tree to erlang term format
Provides dump of tree info to be used in Inspect protocol implementation
Adds key value pair and then ensures tree is balanced.
Returns list of keys from bottom left of tree to bottom right
Returns key value pair if key lookup is successful
Store tree to file path p, in erlang term format