I want to generate a fixed-length (say 10 characters) hash based on current date & time. This hash will be append to names of the uploaded files from my users. How can I do
Batteries included:
import hashlib import time hash = hashlib.sha1() hash.update(str(time.time())) print hash.hexdigest() print hash.hexdigest()[:10]