MCPcopy
hub / github.com/ethereum/research / bit_length

Method bit_length

binius/binary_fields.py:98–99  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

96 return '<'+str(self.value)+'>'
97
98 def bit_length(self):
99 return 1 << (self.value.bit_length() - 1).bit_length()
100
101 def to_bytes(self, length, byteorder):
102 assert length >= (self.bit_length() + 7) // 8

Callers 15

to_bytesMethod · 0.95
next_power_of_twoFunction · 0.80
reverse_bit_orderFunction · 0.80
compute_sizeFunction · 0.80
log2Function · 0.80
get_branchFunction · 0.80
binmulFunction · 0.80
invMethod · 0.80
log2Function · 0.80
reverse_bit_orderFunction · 0.80
compressFunction · 0.80

Calls

no outgoing calls

Tested by 1

compute_sizeFunction · 0.64