Or do only bitfields like bytes32 support the xor function (a ^ b)?

Related, Why can't we do bitwise operations on Bools?

1 Answer 1


See https://solidity.readthedocs.io/en/develop/types.html#value-types for which operators are defined for which types, but no, bitwise operators aren't defined on dynamically-sized arrays.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.