I need a random string generator that generates an alpha-numeric string to use as an unique key in a distributed system that is 30 characters or less. It cannot contain any special characters.
Will RandomStringUtils#randomAlphanumeric work for this?
The underlying implementation uses java.util.Random
.
The set of unique keys will probably be less than 100 billion, and the system needs to be able to handle up to 1000 records per second.
How can I prove that this strategy has a low enough probability of collision to work as a primary key generator?