I want to convert this C++ code to Python v2:
static unsigned char asConvCode[3] = {0xFC, 0xCF, 0xAB};
void asConv(char* str, int size)
{
int i = 0;
for (i = 0; n< size; n++)
{
str[i] ^= asConvCode[n % 3];
}
}
tried to make like that:
def asConv(self, data):
asConvCode= [0xFC, 0xCF, 0xAB]
for i in range(len(data)):
data[i] ^= asConvCode[i % 3] # Error: Unsupported operand type(s) for ^=: ...
return data
I will be happy for any hint