First of all I'm not a Python expert, so here is my topic:
I want to invert a number, let say number = "ABCD123" (yes this is a string but I need to do it this way ...), the problem is that I'm not really satisfy with the way Python deal with the inversion, for example ~0xABCD123 is -180146468 and I don't want the MSB but only the "current" bits to be inverted. I can go with something like ~0xABCD123 & 0XFFFFFFF but the size of the number can actually change...
Question
Is there a way to dynamically "cast" or remove the bit sign in Python with the operator ~