MCPcopy Create free account
hub / github.com/devlongs/gean / HashTreeRootBitlist

Function HashTreeRootBitlist

common/ssz/ssz.go:39–44  ·  view source on GitHub ↗
(bl *types.Bitlist)

Source from the content-addressed store, hash-verified

37}
38
39func HashTreeRootBitlist(bl *types.Bitlist) types.Root {
40 chunks := packBits(bl.Len(), func(i int) bool { return bl.Get(i) })
41 limit := (bl.Limit() + 255) / 256
42 root := Merkleize(chunks, limit)
43 return MixInLength(root, uint64(bl.Len()))
44}
45
46func packBits(n int, get func(int) bool) []types.Root {
47 if n == 0 {

Callers 4

mainFunction · 0.92
HashTreeRootStateFunction · 0.85
TestHashTreeRootBitlistFunction · 0.85

Calls 6

packBitsFunction · 0.85
MerkleizeFunction · 0.85
MixInLengthFunction · 0.85
LimitMethod · 0.80
LenMethod · 0.45
GetMethod · 0.45

Tested by 1

TestHashTreeRootBitlistFunction · 0.68