title: How to randomly generate a function that is a permutation for integers <10000
body: <p>I want to allow users to use the same username, but have some extra id in the form #XXXX where X is a number (for instance, BestUserName#3421), similar to how is done on Battle.net for instance.</p>
  
  <p>No two users should have the same username and #id combination.</p>
  
  <p>Also, I don't want my users to be able to easily predict the extra id of other users. So, I can't just start with BestUserName#0000, then BestUserName#0001, BestUserName#0002, …).</p>
  
  <p>Therefore, I want to generate, for each username, a bijection f(n) from all numbers between 0000 and 9999 to every number between 0000 and 9999. f must makes it hard to guess what f(n-1) is when you know f(n). Also, f(n) must be not be the same for all usernames.</p>
  
  <p>Then the first user will be BestUserName#f(0000), the second one BestUserName#f(0001), and so on, and my users won't be able to guess each other's #id.</p>
  
  <p>How can I do this in Java ?</p>