title: Best way to generate order numbers for an online store?
body: <p>Every order in my online store has a user-facing order number. I'm wondering the best way to generate them. Criteria include:</p>
  
  <ul>
  <li>Short</li>
  <li>Easy to say over the phone (e.g., "m" and "n" are ambiguous)</li>
  <li>Unique</li>
  <li>Checksum (overkill? Useful?)</li>
  <li><strong>Edit:</strong> Doesn't reveal how many total orders there have been (a customer might find it unnerving to make your 3rd order)</li>
  </ul>
  
  <p>Right now I'm using the following method (no checksum):</p>
  
  <pre><code>def generate_number                
      possible_values = 'abfhijlqrstuxy'.upcase.split('') | '123456789'.split('')
  
      record = true
      while record
          random = Array.new(5){possible_values[rand(possible_values.size)]}.join
          record = Order.find(:first, :conditions =&gt; ["number = ?", random])
      end          
      self.number = random
  end
  </code></pre>