merkletree

package module
v0.0.0-...-51db6fe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const BlockSize = 32

Variables

View Source
var (
	TreeHeight      = 40
	DefaultHash     = crypto.SHA1
	BranchingFactor = 2
)

Functions

func New

func New() hash.Hash

Types

type Block

type Block []byte

type MerkleTree

type MerkleTree struct {
	// contains filtered or unexported fields
}

func (MerkleTree) BlockSize

func (tree MerkleTree) BlockSize() int

func (*MerkleTree) Close

func (tree *MerkleTree) Close()

Sending nil through tree will terminate all running goroutines

func (MerkleTree) Reset

func (tree MerkleTree) Reset()

func (MerkleTree) Size

func (tree MerkleTree) Size() int

func (*MerkleTree) Start

func (tree *MerkleTree) Start()

func (MerkleTree) Sum

func (tree MerkleTree) Sum(b []byte) []byte

Sum appends hash of underlaying data into b and returns the hash as well

func (MerkleTree) Write

func (tree MerkleTree) Write(data []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL