Best way to generate order numbers for an online store?

前端 未结 13 2070
野的像风
野的像风 2021-01-31 00:09

Every order in my online store has a user-facing order number. I\'m wondering the best way to generate them. Criteria include:

  • Short
  • Easy to say over the
13条回答
  •  悲&欢浪女
    2021-01-31 00:39

    http://blog.logeek.fr/2009/7/2/creating-small-unique-tokens-in-ruby

    >> rand(36**8).to_s(36)
    => "uur0cj2h"
    

提交回复
热议问题