MCPcopy Create free account
hub / github.com/DNAProject/DNA / highBit

Function highBit

merkle/util.go:40–47  ·  view source on GitHub ↗

return the position of the heightest 1 bit 1-based index

(num uint32)

Source from the content-addressed store, hash-verified

38// return the position of the heightest 1 bit
39// 1-based index
40func highBit(num uint32) uint {
41 var hiBit uint
42 for num != 0 {
43 num >>= 1
44 hiBit += 1
45 }
46 return hiBit
47}
48
49// return the position of the lowest 1 bit
50// 1-based index

Callers 4

subproofMethod · 0.85
InclusionProofMethod · 0.85
lowBitFunction · 0.85
_hash_fullMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected