Created
April 24, 2014 18:41
-
-
Save mitshel/11265000 to your computer and use it in GitHub Desktop.
Генерация уникальной последовательности на python (время + случайное число) на все вычисляется хэш
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import os | |
import hashlib | |
t1=time.time() | |
t2=''.join([hex(c).replace('0x','') for c in os.urandom(8)]) | |
code=hashlib.md5((str(t1)+t2).encode()).hexdigest() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment