RE: [PHP] GUID or any other unique IDs

2005-10-26 Thread Denis Gerasimov
Hello Ben, > While not ideal, you could do a select on a db. MS SQL and MySQL both have > functions to generate unique id's and I imagine the other databases do as > well. While running a "SELECT uuid()" and hitting the database for each > one of these things is annoying, it is one possible pseudo

RE: [PHP] GUID or any other unique IDs

2005-10-25 Thread Jasper Bryant-Greene
On Tue, 2005-10-25 at 14:47 +0400, Denis Gerasimov wrote: > > $unique_id = sha1( uniqid( mt_rand(), true ) ); > > > > which should be very unique and suitable for most purposes. > > I really need millions of unique IDs - hashing is not suitable for this task > (I think so) :-(. Any more ideas? T

Re: [PHP] GUID or any other unique IDs

2005-10-25 Thread Richard Lynch
On Tue, October 25, 2005 4:01 am, 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. There is some discussion here you may find useful: http://www.php.net/uniqid > I really need "true" unique identifiers - md5() hash is no

Re: [PHP] GUID or any other unique IDs

2005-10-25 Thread Ben Litton
While not ideal, you could do a select on a db. MS SQL and MySQL both have functions to generate unique id's and I imagine the other databases do as well. While running a "SELECT uuid()" and hitting the database for each one of these things is annoying, it is one possible pseudo-solution. O

RE: [PHP] GUID or any other unique IDs

2005-10-25 Thread Denis Gerasimov
Hello Jasper, > $unique_id = sha1( uniqid( mt_rand(), true ) ); > > which should be very unique and suitable for most purposes. I really need millions of unique IDs - hashing is not suitable for this task (I think so) :-(. Any more ideas? Is there a PHP extension or an external library for gene

Re: [PHP] GUID or any other unique IDs

2005-10-25 Thread Jasper Bryant-Greene
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 and > http://pecl.php.net but found nothing suitable > t

Re: [PHP] GUID or any other unique IDs

2005-10-25 Thread Richard Davey
Hi Denis, Tuesday, October 25, 2005, 10:01:48 AM, you wrote: > I am in a need of GUID generator but it seems that PHP doesn't have > this as a built-in feature. uniqid() ? Bearing in mind of course that no unique ID generator can ever be 100% unique unless it keeps a record of previously genera