hash() = binary()
skewed() = #skewed{root = tree(), count = non_neg_integer()}
tree() = #leaf{hash = hash(), value = any()} | #empty{hash = hash()} | #node{hash = hash(), height = non_neg_integer(), left = tree(), right = tree()}
add/3 | Add/stack new value (leaf) on top and recalculate root hash. |
count/1 | get the number of leaves int he skewed tree. |
hash_value/1 | A commonly used hash value for skewed trees. |
height/1 | Get the height of the given skewed tree. |
new/0 | Create new empty skewed merkle tree. |
new/1 | |
root_hash/1 | Gets the root hash of the given skewed tree. |
verify/3 | Verify will check that the HashToVerify is correctly in the tree with the provided, in order, lists of hashes (proof) and compare it to the RootHash. |
Add/stack new value (leaf) on top and recalculate root hash.
count(Skewed::skewed()) -> non_neg_integer()
get the number of leaves int he skewed tree.
hash_value(Value::any()) -> hash()
A commonly used hash value for skewed trees. This function will SHA256 hash the given value when it is binary. A convenience form detects non-binary forms and uses term_to_binary/1 to convert other erlang terms to a binary form. It is not recommended to use the non-binary form if the resulting trees or proofs are to be sent over a network.
height(Skewed::skewed()) -> non_neg_integer()
Get the height of the given skewed tree. This is a fast operation since the height was calculated on construction of the tree.
new() -> skewed()
Create new empty skewed merkle tree.
Gets the root hash of the given skewed tree. This is a fast operation since the hash was calculated on construction of the tree.
Verify will check that the HashToVerify is correctly in the tree with the provided, in order, lists of hashes (proof) and compare it to the RootHash.
Generated by EDoc