根据一checksum算法需要将一些参数按位取反
例:参数 13
数字13二进制为1101
[((x)) for x in str(bin(13))]
['0', 'b', '1', '1', '0', '1']
除去0b字符串然后按位取反得到0010
[(1^int(x)) for x in str(bin(13)).replace('0b','')]
[0, 0, 1, 0]
然后将得到的2进制转换成十进制数字
int(''.join([str(1^int(x)) for x in str(bin(13)).replace('0b','')]), 2)
2
数字57按位取反得到6
int(''.join([str(1^int(x)) for x in str(bin(57)).replace('0b','')]), 2)
6