Skip to content

Instantly share code, notes, and snippets.

@mitshel
Created April 24, 2014 18:41
Show Gist options
  • Save mitshel/11265000 to your computer and use it in GitHub Desktop.
Save mitshel/11265000 to your computer and use it in GitHub Desktop.
Генерация уникальной последовательности на python (время + случайное число) на все вычисляется хэш
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