If these have to be unique, I would base them on "the seconds" as that is very unlikely to be duplicated, unless you generate them all at once, so produce many per second. Converting the seconds to hex gives 8 characters, so that could be most of the first segment in your ID.
Then you could add in some machine-specific identifier if the IDs generated by different people all had to be unique. Then pad it out to the correct length with random characters as before. Cheers, Sarah On Sat, Jun 21, 2008 at 2:12 PM, Sivakatirswami <[EMAIL PROTECTED]> wrote: > I'm building a PicLens Publisher here that will do pretty much what the > current PicLens Publisher does from CoolIris, with some additions to their > Media RSS format that their app does not do. > (see www.piclens.com) > > One thing I need to emulate is their GUID (Global Unique ID) generator which > outputs unique len(36) random strings like > > 557B4610-65DC-4FEA-B6DC-32C3FA4B374D > > 24D2C85A-DD13-4B5D-9CCF-8F3ADC3E6CC7 > > 6B8CD7AA-11B5-4A0D-8EF1-0D6B18C80A17 > > 0B7815AE-AC47-457D-B2CA-F0280947220D > > there is no significance to these strings other than that the uniqueness of > the string being close to infinity i.e. unlikely every to be duplicated > again. > > This is something brand new for me... I'm curious if anyone knows the > patterns here or has any idea of the algorithm being used. It does appear > that the alpha chars are always a) caps b) never go beyond F This hints at a > hexidecimal system underlying the algorithm. > I presume one could request a random selection from the hex set: > 0123456789ABCDEF > and call this 36 times. i don't know why there is any need for hyphenated > segments other than for readability.... > > But, it's pretty simple to write a generator the appears to emulate the > algorithm.. I have this so far and it seems to do the job... any insights? > > on mouseUp > repeat 5 times > repeat 9 times > put GetRandomHex() after tGUID > end repeat > put "-" after tGUID > repeat 3 times > repeat 4 times > put GetRandomHex() after tGUID > end repeat > put "-" after tGUID > end repeat > repeat 12 times hexSet [tPickAnyOne] > put GetRandomHex() after tGUID > end repeat > put tGUID & cr after tOutPut > put empty into tGUID > end repeat > put tOutPut > end mouseUp > > function GetRandomHex > put "0 1 2 3 4 5 6 7 8 9 A B C D E F" into hexSet > split hexSet by " " > put random(16) into tPickAnyOne > return hexSet [tPickAnyOne] > end GetRandomHex > > delivers > > F2ACEA9EB-C3A5-F4CE-05B5-92888E1E80FA > 66A5365D3-EF9A-EF00-66EB-6C82663130B7 > 65634AD6D-8577-A757-310F-47287CF85389 > E2A1DC66D-C58C-1F26-26BF-35EA95A46B5C > BC04061AC-E3C5-3DEC-6EF3-7397B7757F8A > > > Seem OK? > > > _______________________________________________ > use-revolution mailing list > [email protected] > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution > _______________________________________________ use-revolution mailing list [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
