So I'm trying to xor random, which is 4 bytes, with every four bytes of something. The thing is, I want to change random to ans (which is the result of the xor) and then keep going. So basically the random variable will be a fixed number the first time but will change afterwards until the loop ends. My code seems to have the correct logic, however, I keep getting (operator ^ not defined on slice)
random := 4 bytes
for j:=0;j<len(something);j+=4{
ans:=something[j:j+4] ^ random
random=ans
}
My guess is, slice doesn't allow xor, and something will have to be slice since I'm kind of slicing the array into multiple bytes. Any idea how to solve this problem?