Skip to content

Instantly share code, notes, and snippets.

@nloadholtes
Created May 16, 2013 19:40
Show Gist options
  • Save nloadholtes/5594462 to your computer and use it in GitHub Desktop.
Save nloadholtes/5594462 to your computer and use it in GitHub Desktop.
Scramble text into oblivion
import random
import string
CHARS = string.letters + " " + string.digits
def scramble(input, keep_length=True):
output = []
for x in input:
output.append(random.choice(CHARS))
return "".join(output)
if __name__ == '__main__':
text = "This is my input text that should be scrambled."
print(text)
print(scramble(text))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment