add list_to_int() utility function to convert byte-lists to integers
This commit is contained in:
parent
e786eb1310
commit
6d5127c89a
4
utils.py
4
utils.py
|
@ -65,3 +65,7 @@ def swap_nibbles(array):
|
||||||
for a in array:
|
for a in array:
|
||||||
rc.append(((a & 0xf0) >> 4) | ((a & 0x0f) << 4))
|
rc.append(((a & 0xf0) >> 4) | ((a & 0x0f) << 4))
|
||||||
return rc
|
return rc
|
||||||
|
|
||||||
|
# Convert from list of bytes to big-endian integer
|
||||||
|
def list_to_int(arr):
|
||||||
|
return int(hexdump(arr), 16)
|
||||||
|
|
Loading…
Reference in New Issue