diff options
Diffstat (limited to 'gn3/random.py')
-rw-r--r-- | gn3/random.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gn3/random.py b/gn3/random.py new file mode 100644 index 0000000..f0ba574 --- /dev/null +++ b/gn3/random.py @@ -0,0 +1,11 @@ +""" +Functions to generate complex random data. +""" +import random +import string + +def random_string(length): + """Generate a random string of length `length`.""" + return "".join( + random.choices( + string.ascii_letters + string.digits, k=length)) |