I'm looking to create a deterministic number generation function where the input number will always generate the same number, but no two numbers will end up generating the same result.
E.g.:
1 -> 3
2 -> 5
3 -> 4
4 -> 2
5 -> 1
However I need this to work for all numbers that can be represented by a specific datatype, e.g. an int64.
This feels like something that should either be really straightforward, or completely impossible. Is there some random number generation scheme that guarantees this sort of distribution without me having to create an array of all possible numbers, randomly sort, and then use the index (and making me run out of memory in the meantime)?
Many thanks F