Skip to content

Instantly share code, notes, and snippets.

@chr15m
Created January 9, 2018 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chr15m/1620a2f4bb641284fb537e65c11a84c9 to your computer and use it in GitHub Desktop.
Save chr15m/1620a2f4bb641284fb537e65c11a84c9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# two hex encoded strings coming in on stdin
# will get xored and output as a hex encoded string
import fileinput
lines = [l for l in fileinput.input()]
print hex(int(lines[0], 16) ^ int(lines[1], 16)).replace("0x", "").rstrip("L")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment