??? You're taking something (the string returned by createUID()) that has a high probability of being unique and severely increasing the probability that it isn't by taking a small substring. And what's the point of the "a"? - Gordon
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kumar Sent: Wednesday, March 07, 2007 11:18 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Not able to generate GUID Use the below function it will return you a GUID public function getUID():String { uidNumber=UIDUtil.createUID(); return 'a'+uidNumber.substr(0,5); } Thanks, Kumar ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Gordon Smith Sent: Wednesday, March 07, 2007 5:39 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Not able to generate GUID > Any reason why Flex/Actionscript can't use the MAC address or the > CPU's information to get a "true" GUID? The Flash Player doesn't currently give access to this information. - Gordon ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of scott_flex Sent: Tuesday, March 06, 2007 3:19 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Not able to generate GUID Well.. i appreciate all the clarification on how the UID is generated. That certainly builds my confidence that it will stay unqiue... and even at that these ids will be split between different tables in my database so that further decreases the chances of collision. And the UID's can be used in uniqueidentifier column types in SQL Server. Using the Flex's createUID does make my life a lot simpler. Any reason why Flex/Actionscript can't use the MAC address or the CPU's information to get a "true" GUID? --Scott --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Gordon Smith" <[EMAIL PROTECTED]> wrote: > > createUID() uses ActionScript's Math.random() to generate 24 of the 32 > bytes of the UID; the other 8 are determined from the current date- time. > The chance that these UIDs wouldn't be good enough for database keys is > very small. But just in case, couldn't you simply call createUID() again > if the database errored because a new row didn't have a unique key? > > - Gordon > > ________________________________ > > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of scott_flex > Sent: Tuesday, March 06, 2007 1:36 PM > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] Re: Not able to generate GUID > > > > > My initial concerns was that it would give a true GUID. > > This statement from the Flex Live docs on adobe.com states: "This UID > will not be truly globally unique; but it is the best we can do > without player support for UID generation." > > Maybe i'm reading that wrong... but i'm not getting the sense that I > can guarantee these numbers to be unique across the board and be used > to uniquely identify rows in a database... either as the primary key > itself but most likely to determine the PK based on the rowGUID > column. > > --Scott > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders% 40yahoogroups.com> > , "Gordon Smith" <gosmith@> wrote: > > > > What are your concerns regarding createUID()? > > > > - Gordon > > > > ________________________________ > > > > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders% 40yahoogroups.com> > > [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders% 40yahoogroups.com> > ] On > > Behalf Of scott_flex > > Sent: Monday, March 05, 2007 4:57 PM > > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders% 40yahoogroups.com> > > Subject: [flexcoders] Not able to generate GUID > > > > > > > > > > Is there no function or object to generate a GUID, a true globally > > unique identifier? > > > > the createUID is not what i'm looking for, just figured generating > a > > GUID would be something pretty basic. > > >