Re:Be Careful with UUID or GUID as Primary Keys
by nvivo on Friday June 09, 2017 @04:23PM
(#14524230)
I'm not sure what you mean exactly. The textual representation of an UUID HAS all the bits intact. UUID formatting is not lossy compression.
[ Parent
| on HN ]
Re:Be Careful with UUID or GUID as Primary Keys
by MichaelGG on Friday June 09, 2017 @04:25PM
(#14524242)
UUID v4 "spec" leaves 122 bits for randomness and has 6 fixed bits for "version" information. I'm suggesting that following the spec on such stuff is a total waste and serves no point, and you're better off with a random 128-bit number.
Re:Be Careful with UUID or GUID as Primary Keys
by nvivo on Friday June 09, 2017 @06:41PM
(#14525126)
Well, then it's not an UUID. It's just 128 random bits. If you just want to be the most random possible, you can go 256, 512, 1024, etc. That may be what you want, but you can't say UUID v4 is a "total waste" or "serves no point".
It's purpose is to never collide with another UUID v4, not to be the most unique value ever.
Re:Be Careful with UUID or GUID as Primary Keys
by MichaelGG on Friday June 09, 2017 @09:00PM
(#14525641)
UUIDv4 is a 122 bit random number. Having another 6 random bits won't make them collide.
Also if there's UUIDs in your system colliding with a 128 bit random numbers then the rng is broken or your UUID generator would be great to crack encryption keys.