MCPcopy Create free account
hub / github.com/SmartPool/smartpool-client / _augHash

Function _augHash

mtree/aug_mt.go:81–97  ·  view source on GitHub ↗
(a, b NodeData)

Source from the content-addressed store, hash-verified

79}
80
81func _augHash(a, b NodeData) NodeData {
82 left := a.(AugData)
83 right := b.(AugData)
84 h := smartpool.SPHash{}
85 keccak := crypto.Keccak256(
86 left.CounterBytes(),
87 append([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, left.Hash[:]...),
88 right.CounterBytes(),
89 append([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, right.Hash[:]...),
90 )
91 copy(h[:smartpool.HashLength], keccak[smartpool.HashLength:])
92 return AugData{
93 Min: _min(left.Min, right.Min),
94 Max: _max(left.Max, right.Max),
95 Hash: h,
96 }
97}
98
99func NewAugTree() *AugTree {
100 mtbuf := list.New()

Callers

nothing calls this directly

Calls 3

_minFunction · 0.85
_maxFunction · 0.85
CounterBytesMethod · 0.80

Tested by

no test coverage detected