rapid XOR method in c++