hash

package
v2.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 8 Imported by: 26

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 added in v2.1.0

func GetMerklePath(index int32, merkleTree [][]byte) [][]byte

func GetMerkleRoot

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

func Prove added in v2.3.3

func Prove(paths [][]byte, merkleRoot, txHash []byte, index uint32, hashType string) bool

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