You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
472 B
Python

#!/usr/bin/python2
import binascii
import sys
import string
for line in sys.stdin:
for pos, eachChar in enumerate(line, 1):
if pos % 4 == 0:
if eachChar in string.ascii_letters:
sys.stdout.write(binascii.unhexlify(hex(int(binascii.hexlify(eachChar), 16) & 119)[2:]))
else:
sys.stdout.write(eachChar)
else:
sys.stdout.write(eachChar)
sys.stdout.flush()
sys.stdout.write('\n')