Versions in this module Expand all Collapse all v1 v1.1.21 Jul 5, 2021 Changes in this version + const HashSize + const MaxHashStringSize + var ErrHashStrSize = fmt.Errorf("max hash string length is %v bytes", MaxHashStringSize) + func CalcMerkleRoot(cfg *types.TuringchainConfig, height int64, txs []*types.Transaction) []byte + func CalcMerkleRootCache(txs []*types.TransactionCache) []byte + func CalcMultiLayerMerkleInfo(cfg *types.TuringchainConfig, height int64, txs []*types.Transaction) ([]byte, []types.ChildChain) + func Computation(leaves [][]byte, flage int, branchpos uint32) (roothash []byte, mutated bool, pbranch [][]byte) + func Decode(dst *Hash, src string) error + func GetHashFromTwoHash(parent []byte, left []byte, right []byte) []byte + func GetMerkleBranch(leaves [][]byte, position uint32) [][]byte + func GetMerkleRoot(hashes [][]byte) []byte + func GetMerkleRootAndBranch(leaves [][]byte, position uint32) (roothash []byte, branchs [][]byte) + func GetMerkleRootFromBranch(merkleBranch [][]byte, leaf []byte, Index uint32) []byte + type Hash [HashSize]byte + func NewHash(newHash []byte) (*Hash, error) + func NewHashFromStr(hash string) (*Hash, error) + func (hash *Hash) CloneBytes() []byte + func (hash *Hash) SetBytes(newHash []byte) error + func (hash Hash) String() string