Auto Generator

Brian K. White brian at aljex.com
Wed Mar 24 15:16:07 PST 2004


Brian K. White wrote:
> You get uniqueness by just putting the few lines of generator code in
> a loop that keeps trying until the result is not found in your
> password database. Rarely will it have to re-try even once, but it
> could loop at least hundreds of times in a second so it's not a loop
> you'd ever be stuck waiting for. 
> 
> this will use rand to generate 8 completely random alpha-num
> characters, that is, it makes no attempt to produce something
> pronounceable. I imagine a database of syllables could be found or
> created fairly easily and instead of generating random characters,
> you pick random records from the syllable file.
> 
> This is off the cuff, so I haven't tested it. probably it won't work
> immediately but this is the idea.
> 
> With a decimal ascii chart that shows all the plain alpha-numeric
> characters fall between ascii 48 and 122 in decimal, and the
> following example from Laura's Help Files:
> then: x = int(RAND() * "100"/"32768") ' Will return numbers 0 to 99.
> 
> I come up with:
> 

jeez it can be even shorter...

@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





> 
> 
> I was originally going to have
> nxtc   :   if:
>        : then: x = ...
>        :   if: ":;<=>?@[/]^_`" co x
>        : then: goto nxtc
>        :   if:
>        : then: pw = pw { x
>        :   if: pw co " "
>        : then: goto nxtc
> 
> before it occurred to me about the alnum edit. that's why the rand
> even bothers to limit it's range from 48 to 122 instead of the
> simpler 0 to 127: x = chr(int(rand()*"128"/"32768"))
> but since I already had it worked out, it doesn't hurt to use it. In
> fact it optimizes the loop so that it needs to re-try less often.
> 
> Brian K. White  --  brian at aljex.com  --  http://www.aljex.com/bkw/
> +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
> filePro BBx  Linux SCO  Prosper/FACTS AutoCAD  #callahans Satriani
> 
> 
> 
> 
> John Esak wrote:
>> Well,
>> I was assuming you could prepend or add some alpha to a random
>> number.  As for being unique. No way with only 8 characters.  Well,
>> you know what I mean.
>> The rand() fuctiion in any language never gaurantees unique'ness. 
>> :-) 
>> 
>> John
>> 
>> 
>>> -----Original Message-----
>>> From: filepro-list-bounces at lists.celestial.com
>>> [mailto:filepro-list-bounces at lists.celestial.com]On Behalf Of
>>> DataDoIt Sent: Wednesday, March 24, 2004 4:03 PM
>>> To: filepro-list at seaslug.org
>>> Subject: RE: Auto Generator
>>> 
>>> 
>>> Does RAND allow for alpha characters?  Online help shows it only
>>> works for numbers.
>>> 
>>> Is it possible to tell RAND to not pull numbers greater than, say,
>>> 36? (0-9, a-z)  I could then decipher if it's a number greater than
>>> 9, pull a corresponding alpha character (10 = a, 11 = b, etc.).
>>> 
>>> Am I making this more complicated than it has to be?
>>> 
>>> -Mike R.
>>> 
>>>> -----Original Message-----
>>>> From: John Esak [mailto:john at valar.com]
>>>> Sent: Wednesday, March 24, 2004 3:42 PM
>>>> To: filepro at datadoit.com
>>>> Cc: filePro mailing list
>>>> Subject: RE: Auto Generator
>>>> 
>>>> 
>>>> I did back in the late 80's on an NCR system... but I could
>>>> never find it
>>>> now. However, it would only be a line or two of code using rand().
>>>> 
>>>> John Esak
>>>> 
>>>> 
>>>>> -----Original Message-----
>>>>> From: filepro-list-bounces at lists.celestial.com
>>>>> [mailto:filepro-list-bounces at lists.celestial.com]On Behalf
>>>> Of DataDoIt
>>>>> Sent: Wednesday, March 24, 2004 2:38 PM
>>>>> To: filepro-list at seaslug.org
>>>>> Subject: Auto Generator
>>>>> 
>>>>> 
>>>>> Has anyone ever created an auto password generator from filePro?
>>>>> Something
>>>>> that will create a random 8 digit alphanumeric passcode, yet
>>>> be unique.
>>>>> 
>>>>> -Mike R.
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> Filepro-list mailing list
>>>>> Filepro-list at lists.celestial.com
>>>>> http://mailman.celestial.com/mailman/listinfo/filepro-list
>>>> 
>>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Filepro-list mailing list
>>> Filepro-list at lists.celestial.com
>>> http://mailman.celestial.com/mailman/listinfo/filepro-list
>> 
>> _______________________________________________
>> Filepro-list mailing list
>> Filepro-list at lists.celestial.com
>> http://mailman.celestial.com/mailman/listinfo/filepro-list
> 
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list


More information about the Filepro-list mailing list