summaryrefslogtreecommitdiffstats
path: root/dmaap/dmaapplugin/dmaaputils.py
diff options
context:
space:
mode:
Diffstat (limited to 'dmaap/dmaapplugin/dmaaputils.py')
-rw-r--r--dmaap/dmaapplugin/dmaaputils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/dmaap/dmaapplugin/dmaaputils.py b/dmaap/dmaapplugin/dmaaputils.py
index e043a07..9e80416 100644
--- a/dmaap/dmaapplugin/dmaaputils.py
+++ b/dmaap/dmaapplugin/dmaaputils.py
@@ -19,10 +19,11 @@
# Utility functions
import string
-import random
+from random import SystemRandom
def random_string(n):
'''
Create a random alphanumeric string, n characters long.
'''
- return ''.join(random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits) for x in range(n))
+ secureRandomGen = SystemRandom()
+ return ''.join(secureRandomGen.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits) for x in range(n))