I'm trying to create a function timestampToRandom(X, Y)
which basically will take the current timestamp and create a number between X
and Y
based on the current timestamp. The function is supposed to be run every Z
seconds, so the outcome of the function has to be "random" based on the current timestamp. This is so that every user that visits the website will get the same "random" outcome of the function as long as X
and Y
is the same for every user.
I can't just clip the timestamp to the last digits because it will then have a repeating pattern of outcome (1,2,3,4,5,6,7,8,9,0 repeat).
What would be the best way to do this?