in reply to Re: Re: Re: Use time() to create unique ID
in thread Use time() to create unique ID
If you are attempting to start an argument with me, you failed. I agree with you.
I wasn't "attempting to start an argument" with anyone. I was pointing out a conceptual misunderstanding that you displayed both with your code and with the assertion you made in the post I was replying to: "However the longer the key the more likely it is to be unique."
As your code uses a pseudorandom generator, the length of the "key" isn't the limiting factor... the length of the seed is.
Hence why elsewhere in this thread I make reference to using system entropy as they do in PGP and GNUpg and other cryptographic products.
And, elsewhere, I point out that relying on randomness for creating unique identifiers is a poor approach altogether.
There are two points to be made here. 1) Using real random numbers rather than pseudorandom numbers doesn't fix the problem with relying on randomness for generating unique IDs. 2) Using a longer "key" length is not at all guaranteed to reduce the number of duplicates you will get.
I was addressing #2 in this thread and #1 in the other.
-sauoq "My two cents aren't worth a dime.";
|
|---|