Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (2.6k points)
I know that randomized UUIDs have a very, very, very low probability for collision in theory, but I am wondering, in practice, how good Java's randomUUID() is in terms of not having collision? Does anybody have any experience to share?

1 Answer

0 votes
by (46k points)

UUID uses java.security.SecureRandom, which is deemed to be "cryptographically strong". While the exact implementation is not determined and can change within JVMs (indicating that any appropriate allegations made are legitimate only for one precise JVM), it ingests mandate that the amount need pass a statistically unpredictable number generator test.

It's infinitely desirable for an implementation to include subtle bugs that break all this (see OpenSSH key production bug) but I don't believe there's any particular purpose to bother about Java UUIDs's randomness.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...