The challenge#

Write a function that takes two equal-length buffers and produces their XOR combination.

If your function works properly, then when you feed it the string:


... after hex decoding, and when XOR'd against:


... should produce:


The solution#

💭 Like the previous challenge, the input strings are in hex. Since we are talking about XOR, we can directly perform bitwise XOR operation on the individual characters (numberical representation), without having to convert them to binary in out code.



  • Hex representation is for human consumption. Don't get lost in what it looks like, know what it represents.
  • "It's like a finger pointing away to the moon. Don't concentrate on the finger or you will miss all that heavenly glory."
Tweet this | Share on LinkedIn |