From 0a87244319dde815c9a48bc13675272521dcfe12 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 6 Dec 2013 20:51:33 +0400 Subject: [PATCH] don't use python's random for session IDs --- utils/__init__.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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]") -- 1.7.1