import hashlib
import time
hash = hashlib.sha1()
hash.update(str(time.time()))
print(hash.hexdigest())
print(hash.hexdigest()[:10])
How to generate a fixed-length hash based on current date and time in Python?