BitVector 操作不可能

BitVector operations impossible

我想对两个 BitVector 执行异或运算。在尝试将其中一个字符串转换为 bitVector 以进行异或运算时,出现以下错误:

ValueError: invalid literal for int() with base 10: '\x91'

如何绕过这个问题?我只想异或两个表达式,但其中一个是字符串,需要先将其转换为位向量,对吗?但是,尝试将字符串转换为 BitVector 会出现上述错误。

    to_be_xored = BitVector.BitVector(bitstring= variable)

其中变量是字符串,to_be_xored 是所需的 Bitvector。

bitstring 用于 '0''1' 的序列。要使用文本,请改用 textstring