Commit Graph

3 Commits

Author SHA1 Message Date
Wei Yang b415f08c46 make it a package bc 2017-10-22 10:20:14 +08:00
Wei Yang 5e43c770ee merkle tree: fix the implementation and add a test case
Merkle tree requires a full binary tree, which means the number of node is
power of 2 and the level of the tree is log(N) instead of N/2.

This patch duplicate the node to a power of 2 number and correct the level
calculation. Besides it adds a test case with 6 nodes.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
2017-10-16 12:45:37 +08:00
Ivan Kuznetsov 668d209f5e Implement Merkle tree 2017-09-18 12:45:58 +07:00