Browse Source

add list_to_int() utility function to convert byte-lists to integers

for/master/fixoption
Harald Welte 4 years ago
parent
commit
6d5127c89a
  1. 4
      utils.py

4
utils.py

@ -65,3 +65,7 @@ def swap_nibbles(array):
for a in array:
rc.append(((a & 0xf0) >> 4) | ((a & 0x0f) << 4))
return rc
# Convert from list of bytes to big-endian integer
def list_to_int(arr):
return int(hexdump(arr), 16)

Loading…
Cancel
Save