From: ThomasV Date: Fri, 6 Dec 2013 16:51:33 +0000 (+0400) Subject: don't use python's random for session IDs X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=commitdiff_plain;h=0a87244319dde815c9a48bc13675272521dcfe12 don't use python's random for session IDs --- diff --git a/utils/__init__.py b/utils/__init__.py index f6e64f2..d6ff895 100644 --- a/utils/__init__.py +++ b/utils/__init__.py @@ -198,8 +198,8 @@ def DecodeBase58Check(psz): ########### end pywallet functions ####################### def random_string(length): - return ''.join(random.choice(string.ascii_uppercase + string.digits) for x in xrange(length)) - + with open("/dev/urandom", 'rb') as f: + return b58encode( f.read(length) ) def timestr(): return time.strftime("[%d/%m/%Y-%H:%M:%S]")