[thelist] ASP Equivalent for CreateUUID() ?

jeff jeff at members.evolt.org
Tue Apr 3 19:48:05 CDT 2001


chris,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: Chris Evans
:
: Here's the code I use to create UIDS:
:
: [snip of code]
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

i don't know what sort of stress testing you did with this model, but i
found that under load there's no guarantee from one number to the next that
it'll be unique.  here's the first 10 lines of results, notice all the
duplicates?  granted, the chances that people will hit at the same time with
the same cgi.remote_addr are remote, but it's possible (think aol).

1)  2130706433:986319498:172161 - {ts '2001-04-03 17:38:18'}
2)  2130706433:986319498:172161 - {ts '2001-04-03 17:38:18'}
3)  2130706433:986319498:172161 - {ts '2001-04-03 17:38:18'}
4)  2130706433:986319498:172161 - {ts '2001-04-03 17:38:18'}
5)  2130706433:986319498:172161 - {ts '2001-04-03 17:38:18'}
6)  2130706433:986319498:172161 - {ts '2001-04-03 17:38:18'}
7)  2130706433:986319498:172161 - {ts '2001-04-03 17:38:18'}
8)  2130706433:986319498:82565  - {ts '2001-04-03 17:38:18'}
9)  2130706433:986319498:82565  - {ts '2001-04-03 17:38:18'}
10) 2130706433:986319498:82565  - {ts '2001-04-03 17:38:18'}

under a load of 10,000 iterations, it took over 9000 milliseconds.

in contrast, here's the first 10 lines of output using createuuid():

1)  11B64168-61CA-41FC-B64EC9FD91A6BBC4 - {ts '2001-04-03 17:42:49'}
2)  226F0421-5962-47FB-ACC21A6488B9716D - {ts '2001-04-03 17:42:49'}
3)  7036D3A5-1BE4-4304-A369AE92BC5B7FFB - {ts '2001-04-03 17:42:49'}
4)  42A0D769-1CB1-44DD-918350D8BEE84B95 - {ts '2001-04-03 17:42:49'}
5)  804276CA-1C70-453B-92AF6195B0117EF2 - {ts '2001-04-03 17:42:49'}
6)  0FC82D55-C880-49B6-9E04E125F758EA6B - {ts '2001-04-03 17:42:49'}
7)  D067CF7E-9318-4A5E-BFCE36C2426D5FBD - {ts '2001-04-03 17:42:49'}
8)  E5BB8609-AD89-4339-AB773A45988364E6 - {ts '2001-04-03 17:42:49'}
9)  D239FD91-BC42-4615-8BB5594AA0F85366 - {ts '2001-04-03 17:42:49'}
10) 8B8CB7FE-118C-432F-9374E552D2860705 - {ts '2001-04-03 17:42:49'}

always the same number of characters.  contains both alpha and numeric
(harder to forge).  always unique.  in fact, not even close in their
similarity (or lack thereof).  and to boot -- only took just over 1000
milliseconds for 10,000 iterations.

granted, my method of stress testing may not simulate the symptoms of a true
server load, but it still works cf over pretty good.

i'd be curious to know what sort of stress testing you did to come up with
your assessment (not to nitpick mind you, i'm always looking for the
fastest, most efficient way of doing things).

thanks,

.jeff

name://jeff.howden
game://web.development
http://www.evolt.org/
mailto:jeff at members.evolt.org





More information about the thelist mailing list