summaryrefslogtreecommitdiffstats
path: root/pyload/database/User.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-19 18:03:46 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-19 18:03:46 +0200
commite1c22fad3fffb485da400e4b34c094f201a2c72e (patch)
treed360610cdf65e2f1906d3cc9c891f6b80066859d /pyload/database/User.py
parentPEP-8, Python Zen, refactor and reduce code (part 7 in master module/database) (diff)
downloadpyload-e1c22fad3fffb485da400e4b34c094f201a2c72e.tar.xz
range -> xrange
Diffstat (limited to 'pyload/database/User.py')
-rw-r--r--pyload/database/User.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pyload/database/User.py b/pyload/database/User.py
index df510c54f..2aedc3bba 100644
--- a/pyload/database/User.py
+++ b/pyload/database/User.py
@@ -30,7 +30,7 @@ class UserMethods(object):
@style.queue
def addUser(db, user, password):
- salt = reduce(lambda x, y: x + y, [str(random.randint(0, 9)) for _i in range(0, 5)])
+ salt = reduce(lambda x, y: x + y, [str(random.randint(0, 9)) for _i in xrange(0, 5)])
h = sha1(salt + password)
password = salt + h.hexdigest()
@@ -53,7 +53,7 @@ class UserMethods(object):
pw = r[2][5:]
h = sha1(salt + oldpw)
if h.hexdigest() == pw:
- salt = reduce(lambda x, y: x + y, [str(random.randint(0, 9)) for _i in range(0, 5)])
+ salt = reduce(lambda x, y: x + y, [str(random.randint(0, 9)) for _i in xrange(0, 5)])
h = sha1(salt + newpw)
password = salt + h.hexdigest()