[dev] What should we do about GUIDs changing?

Jason M. Felice jfelice at cronosys.com
Fri Feb 27 12:00:19 PST 2004


On Fri, Feb 27, 2004 at 01:48:30PM -0600, Marcus I. Ryan wrote:
> Sounds good, though I don't think that the servername is a good idea; what 
> if
> we change servers, change names,  or use multiple virtual servers, etc.
> Better to just use the hash (though I will suggest the uniqid call I posted
> earlier as it's based not just on microtime, but additional entropy as well
> so should avoid the excessively rare but potential race condition.  *shrug*
> 
> Oh, and as we discussed on IRC, I must have been smoking something "special"
> 'cause I would have sworn until I looked back at my own dataset that we used
> to use md5 hashed item ids before.  We didn't. *sigh*

The idea is not to look up keys using the server name, but to protect
against the possibility of a hash collision from two servers creating
new keys from the same state (at the same point in time, with the same
random number seed).  I don't know what additional entropy PHP uses, but
that's going to be platform-specific anyway.  I'd throw the server name
into the hash just because I'm paranoid, but it probably doesn't matter.

-- 
 Jason M. Felice
 Cronosys, LLC <http://www.cronosys.com/>
 216.221.4600 x302


More information about the dev mailing list