5 ms·
"Short" is relative. 4 billion IDs is likely Unique within an organization, even one the size of IBM, Google or Microsoft.
by awalton 12y ago
"Short" is relative. 4 billion IDs is likely Unique within an organization, even one the size of IBM, Google or Microsoft.
- eldavido 12y agoAt the risk of pedantry, it depends on whether their allocation is centrally coordinated. 4 billion IDs with central coordination isn't too bad, but you need a much, much bigger space to make collision-free, uncoordinated ID assignment practical. Corollary: in a room of 23 randomly selected individuals, there's a 1/2 chance that two individuals share a birthday. 365 days in a year, but only 23 samples gets you to 1/2 chance of collision. Look up the "birthday paradox" for more info on this surprising result.
- jorangreef 12y ago4 billion IDs = 32 bit = Math.pow(2,32). For a 50% chance of collision you need Math.pow(2,32/2) calls to your ID generating function which is 65536 calls. And that's just a 50% chance. Even a 1% chance is too much (for which you would need much less than 65536 calls). I doubt "IBM, Google or Microsoft" are using 32bit UUIDs. "4 billion IDs is likely Unique within an organization" I don't think it's unique within any organization.