csmt v1.0.0 CSMT.Utils
Utility functions required by CSMT.Merkle, CSMT.Log, CSMT.Map.
Link to this section Summary
Functions
Decodes a binary into a tree_node/0 using exprotobuf
Decodes a binary into a tree/0 using exprotobuf
Encodes tree_node/0 into a binary using exprotobuf
Encodes tree/0 into a binary using exprotobuf
Generates a unique TreeId for every tree.
This TreeId is used by Storage and CSMT.TreeStorage for persisting tree/0 and tree_node/0
Utility function to retrieve the backend module from backend
Utility function for retrieving a tree node.
Calls Storage.get_node/2
Hashes the binary data supplied based on the hash algorithm hash_algorithm/0 specified in t:tree
Creates an inner node in the tree of type tree_node/0.
Creates a new node with its children as left and right
Creates a new node in the tree of type tree_node/0
Creates a new tree of type tree/0.
Called by CSMT.Merkle.new/4 when a new CSMT.Map or CSMT.Log has to be created
Utility function for persisting a tree node.
Calls Storage.set_node/3
Helper function to convert a Tuple List into a map.
This is required as CSMT.Trees stores a map as a List of Tuple
Link to this section Types
Link to this section Functions
Decodes a binary into a tree_node/0 using exprotobuf.
Decodes a binary into a tree/0 using exprotobuf.
Encodes tree_node/0 into a binary using exprotobuf.
Encodes tree/0 into a binary using exprotobuf.
Generates a unique TreeId for every tree.
This TreeId is used by Storage and CSMT.TreeStorage for persisting tree/0 and tree_node/0
Utility function to retrieve the backend module from backend.
Utility function for retrieving a tree node.
Calls Storage.get_node/2.
Hashes the binary data supplied based on the hash algorithm hash_algorithm/0 specified in t:tree.
Creates an inner node in the tree of type tree_node/0.
Creates a new node with its children as left and right.
Creates a new node in the tree of type tree_node/0.
make_tree(binary(), hash_algorithm(), backend()) :: tree()
Creates a new tree of type tree/0.
Called by CSMT.Merkle.new/4 when a new CSMT.Map or CSMT.Log has to be created.
Utility function for persisting a tree node.
Calls Storage.set_node/3.
Helper function to convert a Tuple List into a map.
This is required as CSMT.Trees stores a map as a List of Tuple.