Creating unique ID's?
[1/5] from: ingo::2b1::de at: 16-Jul-2002 11:13
Hi Rebols,
I need to create ID's which are unique over even when they are created
on different machines, or several poeple on the same machine, etc. Does
anyone have a better idea than
unique-id: join join system/user/email system/network/host now/precise
Thanks in advance
Ingo
[2/5] from: jason:cunliffe:verizon at: 16-Jul-2002 10:22
> I need to create ID's which are unique over even when they are created
> on different machines, or several poeple on the same machine, etc. Does
> anyone have a better idea than
>
> unique-id: join join system/user/email system/network/host now/precise
clear and simple strategy :-)
with an interesting result also..
>> unique-id: join join system/user/email system/network/host now/precise
== [jason--cunliffe--verizon--netvaio16-Jul-2002]/10:19:11.76-4:00
>> type? unique-id
== email!
That's a fine domain name.
./Jason
[3/5] from: greggirwin:mindspring at: 16-Jul-2002 11:38
Hi Ingo,
<<
I need to create ID's which are unique over even when they are created
on different machines, or several poeple on the same machine, etc. Does
anyone have a better idea than
unique-id: join join system/user/email system/network/host now/precise
>>
I guess that depends on *how* unique they need to be. For example, if you
call this twice in a row, you'll very likely get the same ID so it's not a
good substitute for something like the DCE UUID approach, but that may be
overkill. If you need ID's that are *guaranteed* (or as close as we can get
to that) to be unique across time and space, I think you'll need to do more.
Adding a random element would be a good start.
There was a short discussion on the list in mid-January about UUID
generation.
--Gregg
[4/5] from: joel:neely:fedex at: 16-Jul-2002 14:29
Hi, Ingo,
Ingo Hohmann wrote:
> Hi Rebols,
>
> I need to create ID's which are unique over even when they are created
> on different machines, or several poeple on the same machine, etc. Does
> anyone have a better idea than
>
> unique-id: join join system/user/email system/network/host now/precise
>
If you can stand a *very* small (but non-zero) probability of a
collision, you can avoid publishing user and/or host information
by using
checksum/secure rejoin [
system/user/email system/network/host now/precise
]
which, for example, on one of my boxen gives
#{0CFD7B12DBFAD911FD68BD4AA6862AA5AD3F4D17}
and I'll offer a reward of a virtual cookie to anyone who can
determine who/where/when from the above.
In theory, there's a 1 : 2 ** 80 chance (1 in 1.2E24) of a collision
between different ids.
-jn-
[5/5] from: joel:neely:fedex at: 16-Jul-2002 14:35
Hi, Gregg,
Gregg Irwin wrote:
> <<
> I need to create ID's which are unique over even when they are created
<<quoted lines omitted: 4>>
> I guess that depends on *how* unique they need to be. For example, if you
> call this twice in a row, you'll very likely get the same ID...
It depends on your computer!!!
On a real computer/OS with a microsecond clock, even consecutive
evaluations of NOW/TIME/PRECISE yield different values...
>> reduce [now/time/precise now/time/precise now/time/precise]
== [14:42:25.950478 14:42:25.950988 14:42:25.951521]
>> reduce [now/time/precise now/time/precise now/time/precise]
== [14:42:30.728039 14:42:30.728536 14:42:30.729006]
>> reduce [now/time/precise now/time/precise now/time/precise]
== [14:42:31.277009 14:42:31.277474 14:42:31.27795]
>> reduce [now/time/precise now/time/precise now/time/precise]
== [14:42:31.743064 14:42:31.743529 14:42:31.744091]
... although that doesn't hold true for Visual MS-DOS. ;-)
-jn-
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted