Let's say there are numbers - user id. It is required for each id to generate a (pseudo) random number in the specified range (eg, 1 - 32). Given that there should be a variation depending on the id of the users, even if they differ by one. With the same id, the same number must always be returned. In this case, I would like to achieve adequate entropy.
Clearly:
function getNumber(id, range = 32) { // ... return result } getNumber(123) // Например, 31 getnumber(124) // Например, 5 getNumber(123) // Снова, например, 31 What are the fastest algorithms to solve this problem?
Randompull? - MihailPw