I'm trying to convert a list of hexadecimal strings into little-endian format.
Code:
hex = ['1A05','1A05','1A05']
endian = int(str(hex),16)
print(endian)
However, it doesn't work and throws an error:
ValueError: invalid literal for int() with base 16:
I was expecting:
[1306, 1306, 1306]
Interestingly if I write:
endian = int('1A05',16)
I don't get an error and it returns
6661
But this is the result of interpreting '1A05'
as big-endian. I was expecting to get 1306 (0x051A) as result.