(bl *types.Bitlist)
| 37 | } |
| 38 | |
| 39 | func 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 | |
| 46 | func packBits(n int, get func(int) bool) []types.Root { |
| 47 | if n == 0 { |