Skip to content

Instantly share code, notes, and snippets.

@dnbaker
Created September 3, 2018 14:12
Show Gist options
  • Save dnbaker/67703faca3ddb938eebc64634a92ead5 to your computer and use it in GitHub Desktop.
Save dnbaker/67703faca3ddb938eebc64634a92ead5 to your computer and use it in GitHub Desktop.
Corrupt your text
import sys
import random
if __name__ == "__main__":
for line in sys.stdin if len(sys.argv) < 2 else open(sys.argv[1]):
for char in line:
if char.isalpha():
sys.stderr.write(char if random.choice([0,1]) else chr(ord(char) ^ 32))
else:
sys.stderr.write(char)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment