An Android app from my organization needs to assign each users an UUID(version 4) when they first launch the app, currently we’re using Boost library 1.58.0 for this purpose, our Android app will use JNI to run the code below for generating UUIDv4:
boost::uuids::basic_random_generator<boost::random::lagged_fibonacci44497> generator; generator(); //generating UUIDv4
The code worked fine for years, now we’re deciding to replace it with an API in Java(UUID.randomUUID()). But we think it would be better if we can know about the uniqueness of these two ways before making the change.
- Does the using of boost::random::lagged_fibonacci44497 reduce the chance of two devices using our app having the same UUID(collision)?
- If it is, can we know the probability of collision?
- Is that code better than UUID.randomUUID() in terms of uniqueness?
Source: Android Questions