You are here: Re: [PHP] GUID or any other unique IDs « PHP « IT news, forums, messages
Re: [PHP] GUID or any other unique IDs

Posted by Jasper Bryant-Greene on 10/25/05 12:12

On Tue, 2005-10-25 at 13:01 +0400, Denis Gerasimov wrote:
> I am in a need of GUID generator but it seems that PHP doesn't have this as
> a built-in feature.
>
> I looked at http://pear.php.net <http://pear.php.net/> and
> http://pecl.php.net <http://pecl.php.net/> but found nothing suitable
> there.
>
> I really need "true" unique identifiers - md5() hash is not OK because of
> the "birthday paradox".
>
> Can anyone recommend a way for solving this trouble?

I use:

$unique_id = sha1( uniqid( mt_rand(), true ) );

which should be very unique and suitable for most purposes.

--
Jasper Bryant-Greene
General Manager
Album Limited

e: jasper@album.co.nz
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand

 

Navigation:

[Reply to this 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

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