closed issue 995, thanks Peter

This commit is contained in:
Massimo
2012-09-28 12:38:03 -05:00
parent ccf154a807
commit 2f44c2de9b
3 changed files with 38 additions and 29 deletions
+1 -1
View File
@@ -136,7 +136,7 @@ def web2py_uuid():
and it XORs the output with the tokens uniquely associated with this machine.
"""
try:
bytes = string.join(map(lambda ur, ctoken: chr(random.randrange(256)^ord(ur)^ctoken), os.urandom(16), CTOKENS),'')
bytes = string.join(map(lambda ur, ctoken: chr(random.randrange(256)^ord(ur)^ctoken), os.urandom(16),CTOKENS),'')
except NotImplementedError:
bytes = string.join(map(lambda ctoken: chr(random.randrange(256)^ctoken), CTOKENS),'')
return str(uuid.UUID(bytes=bytes, version=4))