I'm using ramsey/uuid in my project. I'm creating new data entities with uuid4, which generates random UUIDs:
Uuid::uuid4();
But I'm using this approach while bulk importing many thousands of data too. Now I'm worrying about the entropy pool of my system: does uuid4 use a "true" random number which will deplete my entropy pool at some time? Or will it use pseudo-random numbers and I don't have to worry about?
Thanks a lot!
By default, it generates UUIDs from the random_bytes() function in PHP 7, or the polyfill from the paragonie/random_compat library in PHP 5. So its UUIDs are as random as the response from those functions. See the RandomBytesGenerator class.
It depends what you're doing with the UUIDs as to whether that randomness is good enough.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With