Differences From Artifact [c924bf11cb]:
- File gluon/utils.py — part of check-in [eba4a35a21] at 2011-08-08 04:53:38 on branch develop — Added web2py 1.98.2 (user: spiffy, size: 4011) [annotate] [blame] [check-ins using]
To Artifact [cd84275670]:
- File gluon/utils.py — part of check-in [5e6e1e2c0a] at 2011-11-20 05:28:20 on branch feature/web2py_auth — Upgraded to web2py 1.99.2 (user: spiffy, size: 4013) [annotate] [blame] [check-ins using] [more...]
︙ | |||
120 121 122 123 124 125 126 127 | 120 121 122 123 124 125 126 127 128 129 | + + | ubytes = [ord(c) for c in os.urandom(16)] # use /dev/urandom if possible bytes = [bytes[i] ^ ubytes[i] for i in range(16)] except NotImplementedError: pass ## xor bytes with constant ctokens bytes = ''.join(chr(c ^ ctokens[i]) for i,c in enumerate(bytes)) return str(uuid.UUID(bytes=bytes, version=4)) |