3 ms·
It is also highly recommended that you include a check digit into it, to minimize the chance of a collision. I've used https://arthurdejong.org/python-stdnum ht
by BerislavLopac 4y ago
It is also highly recommended that you include a check digit into it, to minimize the chance of a collision. I've used https://arthurdejong.org/python-stdnum https://arthurdejong.org/python-stdnum for that purpose.
- sokoloff 4y agoI don't see how a check digit minimizes the chance of collision. (Here, I'm assuming that a check digit is calculated from the other digits. What am I thinking about incorrectly?)
- georgemcbay 4y agoLooking at the docs for the library linked, it appears to be a Verhoeff algorithm check digit... so yeah, you're correct. This is effectively a simplistic stand-in for a CRC type system -- useful to detect if the data has been corrupted, but not useful to avoid collisions.
- TedDoesntTalk 4y agoAnd if someone is worried about UUID collisions, they need to rethink their priorities in life.
- BerislavLopac 4y agoYou are correct, this should teach me not to write comments when I'm too tired. :/ The check digit wouldn't really help with collisions, since if the strings are the same the digit will be too. They are primarily useful when we need to ensure correctness on human input.