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
What about changing the base of current milliseconds since epoch. For example, in JavaScript, changing to base 36:
Date.now().toString(36)
Results in :
"jv8pvlbg"
That should be a safe hash, up to milliseconds, respect date order and smaller than 10.
The only thing is that is not safe, but in your case security is not important right?
Sorry I don't have the answer for python, but it should by straightforward and should nor require any library. My two cents.