user65165
user65165

Reputation: 972

BitVector operations impossible

I want to perform an xor operation on two BitVectors. While trying to turn one of the strings into a bitVector to then proceed into the xor operation, I get the following error:

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

How can I bypass this problem? I just want to xor two expressions, but one of them is a string, and it needs to be turned to a bitvector first right? However, trying to turn the string into BitVector is giving the error above.

    to_be_xored = BitVector.BitVector(bitstring= variable)

where variable is the string, and to_be_xored is the desired Bitvector.

Upvotes: 0

Views: 74

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799200

bitstring is for sequences of '0's and '1's. To use text use textstring instead.

Upvotes: 2

Related Questions