Best way to generate order numbers for an online store?

前端 未结 13 2181
野的像风
野的像风 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:24

    Ok, how about this one?

    Sequentially, starting at some number (2468) and add some other number to it, say the day of the month that the order was placed.

    The number always increases (until you exceed the capacity of the integer type, but by then you probably don't care, as you will be incredibly successful and will be sipping margaritas in some far-off island paradise). It's simple enough to implement, and it mixes things up enough to throw off any guessing as to how many orders you have.

提交回复
热议问题