In my application, I want to convert the file URIs (/Users/<>/...
or C://...
) to a unique identifier. The file URIs are the external user input and the generated UUID would be the key (to store some data into the DB).
(Having a UUID was not mandatory. I wanted to convert variable length string to something manageable).
In Java, to convert an arbitrary string to a UUID, I can use UUID.nameUUIDFromBytes
.
It uses MD-5 to generate the UUID.
Does the collision probability of this operation (random string -> UUID) the same as the collision probability of MD5 itself? (process 2^64 inputs to get a 50% possibility)
Or, does converting the input to a UUID increases the collision probability?