This is what I have, currently. Is there any nicer way to do this?
import struct
def int32_to_uint32(i):
return struct.unpack_from("I", struct.pack("i", i))[0]
Not sure if it's "nicer" or not...
import ctypes
def int32_to_uint32(i):
return ctypes.c_uint32(i).value
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With