I have a table with a 32-bit integer primary key with automatic increment in the database, which will produce numbers in the range 1-4294967295.
I would like to keep the convenience of the automatically generated primary key, and my numbers in the application interface look randomly.
Is there a mathematical function that would allow one-to-one two-way conversion between an integer and another ?
For example, a function will take a number and translate it into another:
1 => 1538645623
2 => 2043145593
3 => 393439399
And one more function back:
1538645623 => 1
2043145593 => 2
393439399 => 3
I don’t have to look for an implementation here, but rather a hint that I assume there should be a known math problem somewhere :)