CovenantSQL: Index | Files

package merkle

import ""


Package Files

merkletrie.go patriciatrie.go

func MergeTwoHash Uses

func MergeTwoHash(l *hash.Hash, r *hash.Hash) *hash.Hash

MergeTwoHash computes the hash of the concatenate of two hash.

type Merkle Uses

type Merkle struct {
    // contains filtered or unexported fields

Merkle is a merkle tree implementation (

func NewMerkle Uses

func NewMerkle(items []*hash.Hash) *Merkle

NewMerkle generate a merkle tree according to some hashable values like transactions or blocks.

func (*Merkle) GetRoot Uses

func (merkle *Merkle) GetRoot() *hash.Hash

GetRoot returns the root of merkle tree.

type Trie Uses

type Trie struct {
    // contains filtered or unexported fields

Trie is a patricia trie.

func NewPatricia Uses

func NewPatricia() *Trie

NewPatricia is patricia construction.

func (*Trie) Get Uses

func (trie *Trie) Get(key []byte) ([]byte, error)

Get returns the value according to the key.

func (*Trie) Insert Uses

func (trie *Trie) Insert(key []byte, value []byte) (inserted bool)

Insert serializes key into binary and computes its hash, then stores the (hash(key), value) into the trie.

Package merkle imports 3 packages (graph) and is imported by 4 packages. Updated 2019-04-21. Refresh now. Tools for package owners.