|
|
|
|
|
by anomalroil
1380 days ago
|
|
It does but it does not! java.util.Random is not a CSPRNG at all and is terrible, so even tho the nextInt() method is using rejection sampling, it's still producing biased values and also completely fails to be "unpredictable" because java.util.Random is weak and predictable. |
|
I know there are other parts of the Java standard lib that are so terrible [1] that people for years have recommended not using them, like anything with dates and timezones...
---
[1] or used to, haven't kept up with the latest Java versions. Maybe they fixed it.