I am making UUIDs like this:
Uuid::uuid4();
and save in a database as track id.
Is it possible to create a duplicate UUID?
I am making UUIDs like this:
Uuid::uuid4();
and save in a database as track id.
Is it possible to create a duplicate UUID?
Copyright © 2021 Jogjafile Inc.
If you are not using a
uniquecolumn, then you can look up the UUID from the database and save it in another record. You cannot feasibly generate a duplicate UUID usingUuid:uuid4()without astronomical odds, however.If you intend to use the UUID as a unique identifier, best practice would be to also add a
uniqueconstraint on your database column.