Cryptograhically random unique strings

前端 未结 4 1179
-上瘾入骨i
-上瘾入骨i 2021-01-13 15:00

In this answer, the below code was posted for creating unique random alphanumeric strings. Could someone clarify for me how exactly they are ensured to be unique in this cod

4条回答
  •  伪装坚强ぢ
    2021-01-13 15:45

    Using strictly alphanumeric characters restricts the pool you draw from to 62. Using the complete printable character set(ASCII 32-126) increases your pool to 94, decreasing the likelihood of collision and eliminating creating the pool separately.

提交回复
热议问题