Take this example:
i = 0x12345678
print("{:08x}".format(i))
# Shows 12345678
i = swap32(i)
print("{:08x}".format(i))
# Should print 78563412
What would be the swap32-function()? Is there a way to byte-swap an int in Python, ideally with built-in tools?
array.byteswap()method if you first convert the number into a byte-array{ 12 34 56 78 }, it would be{ 78 56 34 12 }.