MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / generateRandomKey

Function generateRandomKey

src/gamesbyexample/simplesubcipher.py:119–123  ·  view source on GitHub ↗

Generate and return a random encryption key.

()

Source from the content-addressed store, hash-verified

117
118
119def generateRandomKey():
120 """Generate and return a random encryption key."""
121 key = list(LETTERS) # Get a list from the LETTERS string.
122 random.shuffle(key) # Randomly shuffle the list.
123 return ''.join(key) # Get a string from the list.
124
125
126# If this program was run (instead of imported), run the program:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected