Creating a unique alphanumeric 10-character string

前端 未结 7 2153
青春惊慌失措
青春惊慌失措 2020-12-06 12:32

I\'m looking to create a simple short-lived reservation system, and I\'d like to generate confirmation numbers that are

  • unique
  • random-looking
相关标签:
7条回答
  • 2020-12-06 12:58

    Some good tips on this question: How do I create a random alpha-numeric string in C++?

    I'd avoid including characters like "1", "l", and "O", "0" and "5", "S", and "Z", "2" in your string, to make it easier for customers when they need to read your reservation code over the phone. The algorithm presented at that link should help you do this.

    0 讨论(0)
提交回复
热议问题