title: Generating unique reference ids using Hashids
body: <p>In my DB, I need to have unique reference ids to orders, to show the end users.</p>
  
  <p>My schema includes many accounts that can potentially have many customers, which can make many orders (occasionally at the same time - both different customers, and a single customer with many orders)</p>
  
  <p>I've decided to use Hashids in order to solve this. I came up with this:</p>
  
  <pre><code>//create a unique salt using the account id + current timestamp:
  var hashids = new Hashids(accountId + '-' + new Date().getTime(), 8,
  '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ')
  
  //Then, generate a unique id for every order using:
  for(var i = 0; i &lt; orders.length; i++ ) {
     orders[i].ref_number = hashids.encode(i, a.date.getTime())
  }
  </code></pre>
  
  <p>How random would this be?
  How can I validate that?</p>
  
  <p>Thanks</p>