RE: [PHP-WIN] Random Code
| From: | Svensson, B.A.T. | Date: | Tue, 23 Jan 2001 20:15:29 +0000 |
| Subject: | RE: [PHP-WIN] Random Code | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-5173@lists.php.net to get a copy of this message | ||
Just realized a serious problem with this approach: it will, due to its
nature, run very quickly towards +oo ... hence it is not proper to implement
as a computer program.
>-----Original Message-----
>From: Svensson, B.A.T. [mailto:B.A.T.Svensson@lumc.nl]
>Sent: Tuesday, January 23, 2001 9:10 PM
>To: L4@di1.net; php-windows@lists.php.net
>Subject: RE: [PHP-WIN] Random Code
>
>
>If one need to create multiple numbers per second (that is
>cal;culation time
>is critical), then I would suggest, in accordance to my
>previous letter,
>that one should pick a functions that is guaranteed to be constantly
>growing, that is that the property "x1>x2 -> f(x1)>f(x2)"
>always will hold
>true for the function f. If this is the case, then the f will
>be able to
>produce input values for a mapping function that can be guaranteed to
>produce unique numbers.
>
>
>>-----Original Message-----
>>From: Larry Forrister [mailto:L4@stetson.net]
>>Sent: Tuesday, January 23, 2001 7:26 PM
>>To: php-windows@lists.php.net
>>Subject: Re: [PHP-WIN] Random Code
>>
>>
>>Do you mean W3E4-22ER would be valid? If so there would be 36^8
>>(2,821,109,907,456) possible values.
>>
>>A truly random generator algorithm cannot guarantee uniqueness. I'm
>>guessing what you want is to generate each possible value once in a
>>pseudo-random order. Would just apparent randomness suffice?
>>
>>With what frequency do the values need to be generated? Once
>every few
>>seconds/minutes or multiple times per second?
>>~~LF
>>
>>
>>Sigurd Magnusson wrote:
>>
>>> Whats the best way to make a completely random, unique code in the
>>> format "ABCD-1234" where each of the 8 characters can be
>alphanumerc;
>>> 0-9,A-Z... I thought about generating a 36^4 number,
>converting to to
>>> base '36', and repeating the process. What's a good way to
>ensure the
>>> code is not repeated, though?
>>>
>>> Siggy
>>
>>--
>>PHP Windows Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
>>For additional commands, e-mail: php-windows-help@lists.php.net
>>To contact the list administrators, e-mail:
>>php-list-admin@lists.php.net
>>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
>For additional commands, e-mail: php-windows-help@lists.php.net
>To contact the list administrators, e-mail:
>php-list-admin@lists.php.net
>