Skip to content

Latest commit

 

History

History
120 lines (59 loc) · 2.83 KB

peculium_core_merkle_tree.md

File metadata and controls

120 lines (59 loc) · 2.83 KB

Module peculium_core_merkle_tree

Merkle Tree Utilities. Copyright (c) 2013 Alexander Færøy

Authors: Alexander Færøy (ahf@0x90.dk).

Description

This module contains utilities for creating and traversing Merkle Tree's. objects.

Data Types

abstract datatype: merkle_tree_node()

Function Index

from_transactions/1Create a Merkle tree from a list of transactions.
hash/1Utility function for getting the hash of a given Merkle tree node.
left/1Utility function for getting the left child of a given Merkle tree node.
right/1Utility function for getting the right child of a given Merkle tree node.

Function Details

from_transactions/1


from_transactions(Transactions::[transaction(), ...]) -> merkle_tree_node()



Create a Merkle tree from a list of transactions. This function takes a list of transactions and returns the root node of the Merkle tree.

hash/1


hash(TreeNode::merkle_tree_node()) -> hash()



Utility function for getting the hash of a given Merkle tree node.

left/1



Utility function for getting the left child of a given Merkle tree node.

right/1



Utility function for getting the right child of a given Merkle tree node.