1

On the documentation it says:

"Uses cryptographically-strong random number APIs (when available)"

I imagine that this means that there are situations where the unsecure Math.random is used?

Also as a follow up what version is most recommended for generating secure and unique session ids?

Thanks

Vangogh500
  • 939
  • 1
  • 7
  • 17

1 Answers1

0

Version 4 UUID is meant for generating UUIDs from truly-random or pseudo-random numbers. UUID v4 are not giving us guaranteed unique numbers; they are rather practically unique. Probability of getting a duplicate is as follows:

Only after generating 1 billion UUIDs every second for the next 100 years, the probability of creating just one duplicate would be about 50%

So you can go ahead and use it . It's serves a great purpose in a lot of projects securely . Anything after version 4 will help you

karthik006
  • 886
  • 9
  • 19