hash

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 7 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMerkleTree

func BuildMerkleTree(hashType string, hashes [][]byte) ([][]byte, error)

take leaf node hash array and build merkle tree

func Get

func Get(hashType crypto.HashType, data []byte) ([]byte, error)

func GetByStrType

func GetByStrType(hashType string, data []byte) ([]byte, error)

func GetHashAlgorithm

func GetHashAlgorithm(hashType crypto.HashType) (hash.Hash, error)

func GetMerklePath

func GetMerklePath(hashType string, hash []byte, merkleTree [][]byte,
	paths *[][]byte, withRoot bool) (brother []byte, parent []byte)

func GetMerkleRoot

func GetMerkleRoot(hashType string, hashes [][]byte) ([]byte, error)

Types

type Hash

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

func (*Hash) Get

func (h *Hash) Get(data []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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