阅读背景:

如何在二进制整数(python)中保持前导零?

来源:互联网 

I need to calculate a checksum for a hex serial word string using XOR. To my (limited) knowledge this has to be performed using the bitwise operator ^. Also, the data has to be converted to binary integer form. Below is my rudimentary code - but the checksum it calculates is 1000831. It should be 01001110 or 47hex. I think the error may be due to missing the leading zeros. All the formatting I've tried to add the leading zeros turns the binary integers back into strings. I appreciate any suggestions.I need to calculate a checksum for a hex serial




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: