|
Posted by Richard Lynch on 05/17/05 04:29
On Mon, May 16, 2005 12:09 pm, Evert | Rooftop said:
> $id1 $id2 and $id3 are when they are combined unique
>
> * Is there a chance of collision when MD5 is used on the id's and the
> ids are long strings
Yes. I think it's like 1 in 2 billion odds.
If you can concatenate $id1$id2$id3 and get a guaranteed unique string,
why not just use that as your unique string?
There are, of course, several good reasons NOT do, which may or may not
apply to your case:
Exposing the id's would be a security flaw.
Concatenating all three id's isn't really unique, after all. (EG all
three are integer IDs from MySQL.)
The concatenation of all three is WAY too long.
> * Is serialize the fastest way to serialize ;) ?
Probably, but not serializing at all, and stuffing the data directly into
shared memory would perhaps be faster, at least as I vaguely understood
the results of a thread on serialization on this very forum from a month
or two ago. (Check archives for "serialize" "shared memory" and "Rasmus
Lerdorf" who weighed in with a succinct explanation of how to avoid
serialization if that performance hit was really a problem (unlikely as
that was))
--
Like Music?
http://l-i-e.com/artists.htm
[Back to original message]
|