Created
May 16, 2013 19:40
-
-
Save nloadholtes/5594462 to your computer and use it in GitHub Desktop.
Scramble text into oblivion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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