language: Python (python 2.7.3)
date: 108 days 0 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
def sxor(s1,s2):    
    # convert strings to a list of character pair tuples
    # go through each tuple, converting them to ASCII code (ord)
    # perform exclusive or on the ASCII code
    # then convert the result back to ASCII (chr)
    # merge the resulting array of characters as a string
    return ''.join(chr(ord(a) ^ ord(b)) for a,b in zip(s1,s2))
    
print repr(sxor('Hello', 'world'))
  • upload with new input
  • result: Success     time: 0.08s    memory: 8832 kB     returned value: 0

    '?\n\x1e\x00\x0b'