Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if val > -1:
idx = 16
node = val
packed = bytearray(ip.packed)
while idx < bit_count:
if node > self._meta.node_count:
break
node = self._read_node(node, (1 & (packed[idx >> 3] >> 7 - (idx % 8))))
idx += 1
if idx == 16 and bit_count == 128:
self._v6offsetCache[key] = node
if node > self._meta.node_count:
return node
raise IPNotFound("ip not found")