Python COM and distribution issues
Tim Roberts
timr at probo.com
Tue May 15 01:33:25 EDT 2001
hungjunglu at yahoo.com wrote:
>
>Thanks, but I don't think I misunderstood the GUID generation
>mechanism. 128 bits are 128 bits, and I think you did not understand
>that part. 128 is a finite number. It's large enough that people do
>credit card transactions over interenet (high-encryption keys). But
>it's a finite number. There are no magic in computers. A finite
>number is a finite number.
Yes, but you do not seem to grasp how incredibly large it is. 128 bits is
large enough to hold the weight of the earth in nanograms.
>As Mark Hammond mentions again and again in his book: "do not copy
>this GUID, generate it instead by using pythoncom.CreateGuid()" OK, I
>guess what he means is that it's OK to hard-code the GUID numbers,
>but generate them each once using pythoncom.CreateGuid(), and then,
>as I said before, just sit and hope for the best.
The original GUID scheme included the 6-byte MAC ID of the generating
machine, a 4-byte date and time, and an 6-byte random number. Assuming
that the generating machines always have an Ethernet card, it is impossible
for such a scheme to produce a duplicate.
>The chance of
>collision (mean collision time) is probably longer than the age of
>Solar System, but shorter than the age of the Universe.
You are incorrect. Do the math. If you had been generating a billion
GUIDs per second, for every second since the big bang, you would still have
generated only one billionth of the possible GUIDs. 2^128 is unfathomably
large.
--
- Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the Python-list
mailing list