title: Creating unique non guessable base 36 id
body: <p>For an application similar to URL shortener services, I want to create non guessable id's, which you're all familiar with I presume. Here's an example of such an id:</p>
  
  <p><a href="http://example.com/sd23t9" rel="nofollow">http://example.com/sd23t9</a></p>
  
  <p>What is a good and efficient technique to generate these, with minimal (or no) risk of collision when inserting these as a primary key in a database table?</p>
  
  <p><strong>EDIT:</strong><br>
  Piskvor makes an excellent point of course. I should have mentioned that I meant minimal collision risk before the 36^6 limit is met.</p>
  
  <p><strong>EDIT 2</strong><br>
  Eh, scrap that, his point was illustrating much more than that of course. Hmmm. Pregenerating a table with id's then, perhaps (like I've read elsewhere already)? Would that be the most efficient technique when i'm bound to the 36^6 and none-consecutive constraints perhaps?</p>