我想在两个BitVectors上执行xor操作。在尝试将其中一个字符串转换为bitVector,然后继续进行xor操作时,我得到了以下错误:
ValueError: invalid literal for int() with base 10: '\x91'我怎样才能绕过这个问题?我只想对两个表达式进行xor运算,但其中一个是字符串,它需要首先转换为位向量,对吧?但是,尝试将字符串转换为BitVector会产生上述错误。
to_be_xored = BitVector.BitVector(bitstring= variable)其中变量是字符串,to_be_xored是所需的位向量。
发布于 2016-08-09 23:20:30
bitstring用于'0's和'1's序列。若要使用文本,请改用textstring。
https://stackoverflow.com/questions/38854440
复制相似问题