Reply to Re: [PHP] Cache

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация