func (merkle *Merkle) GetRoot() *hash.Hash {
	return merkle.tree[len(merkle.tree)-1]
}
GetRoot returns the root of merkle tree.
package merkle
import (
	"github.com/SQLess/SQLess/crypto/hash"
)
type Merkle struct {
	tree []*hash.Hash
}
func upperPowOfTwo(n uint64) uint64 {
	n--
	n |= n >> 1
	n |= n >> 2
	n |= n >> 4
	n |= n >> 8
	n |= n >> 16
	n |= n >> 32
	n++
	return n
}
func NewMerkle(items []*hash.Hash) *Merkle {
	if len(items) == 0 {
		items = []*hash.Hash{{}}
	}
	upperPoT := upperPowOfTwo(uint64(len(items)))
	maxMerkleSize := upperPoT*2 - 1
	hashArray := make([]*hash.Hash, maxMerkleSize)
	copy(hashArray, items)
	offset := upperPoT
	for i := uint64(0); i < maxMerkleSize-1; i += 2 {
		if hashArray[i] != nil && hashArray[i+1] != nil {
			hashArray[offset] = MergeTwoHash(hashArray[i], hashArray[i+1])
		} else if hashArray[i] != nil {
			hashArray[offset] = MergeTwoHash(hashArray[i], hashArray[i])
		} else {
			hashArray[offset] = nil
		}
		offset++
	}
	merkle := &Merkle{hashArray}
	return merkle
}