Auto Generator
Kenneth Brody
kenbrody at bestweb.net
Wed Mar 24 15:52:09 PST 2004
"Brian K. White" wrote:
[...]
> @keyp : if:
> : then: pw(8,alnum) = ""
> nxtc : if: pw co " "
> : then: pw = pw { chr(int(rand()*"76"/"32768")+"48") ; goto nxtc
> : if:
> : then: msgbox pw ; end
[...]
You can get 3 characters at a time (if you don't mind not using W, X,
Y, or Z) by using base-32. Remember, RAND() returns a 15-bit number,
which fits three 5-bit numbers quite nicely.
base(rand(),"10","32")
Though you do have to remember that randomness does not guarantee
uniqueness.
--
+---------+----------------------------------+-----------------------------+
| Kenneth | kenbrody at spamcop.net | "The opinions expressed |
| J. | http://www.hvcomputer.com | herein are not necessarily |
| Brody | http://www.fptech.com | those of fP Technologies." |
+---------+----------------------------------+-----------------------------+
More information about the Filepro-list
mailing list