Re: Password Generator
This WebDNA talk-list message is from 2004
It keeps the original formatting.
numero = 55821
interpreted = N
texte = Brian,Hey, thanks agin for this code consolidation/upgrade. I have put it in production use with SearchBoise.com and it works like a dream. I even did as you suggested and edited the [tChars] string (removed stuff that confuses most people like 0 and O, as well as 1 and l, etc.), then I added capital letters as well. Very cool, and besides being useful, it also opened my eyes to a technique I had not considered yet (but should have), which is putting the stuff I need in a big text string variable and then using [getchars] to retrieve what I need, when I need it.Another thing, I can *definitely* see this being useful for generating unique session variables by extending the [tPasswordLength] variable to, oh, say, 32... but I'll cross that bridge when I come to it :)Thanks again.-Dan------------------------------------------------------------http://www.StrongGraphicDesign.comhttp://www.SearchBoise.com------------------------------------------------------------On Sat, 24 Jan 2004 14:48:04 -0800 Brian Fries
wrote:>Good example, if a little verbose. Try this code which does the same thing but a bit more >efficienly:>>[text]tPasswordLength=8[/text]>[text]tChars=abcdefghijklmnopqrstuvwxyz01234567890123456789[/text]>[text]tMax=[countchars][tChars][/countchars][/text]>[text]tPass=[/text]>[loop start=1&end=[tPasswordLength]]>[text]tX=[math]ceil([random format=float]*[tMax])[/math][/text]>[text]tPass=[tPass][getchars start=[tX]&end=[tX]][tChars][/getchars][/text]>[/loop]>[tPass]
>>>Note that to add characters - punctuation, capital letters - or to adjust the odds of certain >characters being selected, simply add more characters to the "tChars" string and the rest of the >code will take care of itself.>>- brian>>On Jan 24, 2004, at 10:50 AM, Dan Strong wrote:>>>[!] -- PASSWORD-GENERATOR, created by Dan "I ain't 'fraid of no loop" >>Strong, 2004. FREEWARE. --[/!]>>>>[text show=f]how_many_characters=8[/text]>>>>[loop start=1&end=[how_many_characters]]>> [math show=f]HEADS_OR_TAILS=ceil([RANDOM format=float]*(2))[/math]>> [showif [HEADS_OR_TAILS]=1][text >>show=f]character_type=NUMBER[/text][/showif]>> [showif [HEADS_OR_TAILS]=2][text >>show=f]character_type=LETTER[/text][/showif]>> [showif [character_type]=NUMBER]>> [math show=f]DIGIT_[index]=ceil([RANDOM format=float]*(9))[/math]>> [/showif]>>>> [showif [character_type]=LETTER]>> [math show=f]ALPHABET=ceil([RANDOM format=float]*(26))[/math]>> [showif [ALPHABET]=1][text >>show=f]DIGIT_[index]=a[/text][/showif]>> [showif [ALPHABET]=2][text show=f]DIGIT_[index]=b[/text][/showif]>> [showif [ALPHABET]=3][text show=f]DIGIT_[index]=c[/text][/showif]>> [showif [ALPHABET]=4][text show=f]DIGIT_[index]=d[/text][/showif]>> [showif [ALPHABET]=5][text show=f]DIGIT_[index]=e[/text][/showif]>> [showif [ALPHABET]=6][text show=f]DIGIT_[index]=f[/text][/showif]>> [showif [ALPHABET]=7][text show=f]DIGIT_[index]=g[/text][/showif]>> [showif [ALPHABET]=8][text show=f]DIGIT_[index]=h[/text][/showif]>> [showif [ALPHABET]=9][text show=f]DIGIT_[index]=i[/text][/showif]>> [showif [ALPHABET]=10][text show=f]DIGIT_[index]=j[/text][/showif]>> [showif [ALPHABET]=11][text show=f]DIGIT_[index]=k[/text][/showif]>> [showif [ALPHABET]=12][text show=f]DIGIT_[index]=l[/text][/showif]>> [showif [ALPHABET]=13][text show=f]DIGIT_[index]=m[/text][/showif]>> [showif [ALPHABET]=14][text show=f]DIGIT_[index]=n[/text][/showif]>> [showif [ALPHABET]=15][text show=f]DIGIT_[index]=o[/text][/showif]>> [showif [ALPHABET]=16][text show=f]DIGIT_[index]=p[/text][/showif]>> [showif [ALPHABET]=17][text show=f]DIGIT_[index]=q[/text][/showif]>> [showif [ALPHABET]=18][text show=f]DIGIT_[index]=r[/text][/showif]>> [showif [ALPHABET]=19][text show=f]DIGIT_[index]=s[/text][/showif]>> [showif [ALPHABET]=20][text show=f]DIGIT_[index]=t[/text][/showif]>> [showif [ALPHABET]=21][text show=f]DIGIT_[index]=u[/text][/showif]>> [showif [ALPHABET]=22][text show=f]DIGIT_[index]=v[/text][/showif]>> [showif [ALPHABET]=23][text show=f]DIGIT_[index]=w[/text][/showif]>> [showif [ALPHABET]=24][text show=f]DIGIT_[index]=x[/text][/showif]>> [showif [ALPHABET]=25][text show=f]DIGIT_[index]=y[/text][/showif]>> [showif [ALPHABET]=26][text show=f]DIGIT_[index]=z[/text][/showif]>> [/showif]>> [text >>show=f]DIGIT_[index]=[interpret][DIGIT_[index]][/interpret][/text]>>[/loop]>>>>[loop >>start=1&end=[how_many_characters]][interpret][DIGIT_[index]][/ >>interpret][/loop]
>>>-- Brian Fries, BrainScan Software -- http://www.brainscansoftware.com > -->>>------------------------------------------------------------->This message is sent to you because you are subscribed to> the mailing list .>To unsubscribe, E-mail to: >To switch to the DIGEST mode, E-mail to >Web Archive of this list is at: http://webdna.smithmicro.com/-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Brian,Hey, thanks agin for this code consolidation/upgrade. I have put it in production use with SearchBoise.com and it works like a dream. I even did as you suggested and edited the [tChars] string (removed stuff that confuses most people like 0 and O, as well as 1 and l, etc.), then I added capital letters as well. Very cool, and besides being useful, it also opened my eyes to a technique I had not considered yet (but should have), which is putting the stuff I need in a big text string variable and then using [getchars] to retrieve what I need, when I need it.Another thing, I can *definitely* see this being useful for generating unique session variables by extending the [tPasswordLength] variable to, oh, say, 32... but I'll cross that bridge when I come to it :)Thanks again.-Dan------------------------------------------------------------http://www.StrongGraphicDesign.comhttp://www.SearchBoise.com------------------------------------------------------------On Sat, 24 Jan 2004 14:48:04 -0800 Brian Fries wrote:>Good example, if a little verbose. Try this code which does the same thing but a bit more >efficienly:>>[text]tPasswordLength=8[/text]>[text]tChars=abcdefghijklmnopqrstuvwxyz01234567890123456789[/text]>[text]tMax=[countchars][tChars][/countchars][/text]>[text]tPass=[/text]>[loop start=1&end=[tPasswordLength]]>[text]tX=[math]ceil([random format=float]*[tMax])[/math][/text]>[text]tPass=[tPass][getchars start=[tX]&end=[tX]][tChars][/getchars][/text]>[/loop]>[tPass]
>>>Note that to add characters - punctuation, capital letters - or to adjust the odds of certain >characters being selected, simply add more characters to the "tChars" string and the rest of the >code will take care of itself.>>- brian>>On Jan 24, 2004, at 10:50 AM, Dan Strong wrote:>>>[!] -- PASSWORD-GENERATOR, created by Dan "I ain't 'fraid of no loop" >>Strong, 2004. FREEWARE. --[/!]>>>>[text show=f]how_many_characters=8[/text]>>>>[loop start=1&end=[how_many_characters]]>> [math show=f]HEADS_OR_TAILS=ceil([RANDOM format=float]*(2))[/math]>> [showif [HEADS_OR_TAILS]=1][text >>show=f]character_type=NUMBER[/text][/showif]>> [showif [HEADS_OR_TAILS]=2][text >>show=f]character_type=LETTER[/text][/showif]>> [showif [character_type]=NUMBER]>> [math show=f]DIGIT_[index]=ceil([RANDOM format=float]*(9))[/math]>> [/showif]>>>> [showif [character_type]=LETTER]>> [math show=f]ALPHABET=ceil([RANDOM format=float]*(26))[/math]>> [showif [ALPHABET]=1][text >>show=f]DIGIT_[index]=a[/text][/showif]>> [showif [ALPHABET]=2][text show=f]DIGIT_[index]=b[/text][/showif]>> [showif [ALPHABET]=3][text show=f]DIGIT_[index]=c[/text][/showif]>> [showif [ALPHABET]=4][text show=f]DIGIT_[index]=d[/text][/showif]>> [showif [ALPHABET]=5][text show=f]DIGIT_[index]=e[/text][/showif]>> [showif [ALPHABET]=6][text show=f]DIGIT_[index]=f[/text][/showif]>> [showif [ALPHABET]=7][text show=f]DIGIT_[index]=g[/text][/showif]>> [showif [ALPHABET]=8][text show=f]DIGIT_[index]=h[/text][/showif]>> [showif [ALPHABET]=9][text show=f]DIGIT_[index]=i[/text][/showif]>> [showif [ALPHABET]=10][text show=f]DIGIT_[index]=j[/text][/showif]>> [showif [ALPHABET]=11][text show=f]DIGIT_[index]=k[/text][/showif]>> [showif [ALPHABET]=12][text show=f]DIGIT_[index]=l[/text][/showif]>> [showif [ALPHABET]=13][text show=f]DIGIT_[index]=m[/text][/showif]>> [showif [ALPHABET]=14][text show=f]DIGIT_[index]=n[/text][/showif]>> [showif [ALPHABET]=15][text show=f]DIGIT_[index]=o[/text][/showif]>> [showif [ALPHABET]=16][text show=f]DIGIT_[index]=p[/text][/showif]>> [showif [ALPHABET]=17][text show=f]DIGIT_[index]=q[/text][/showif]>> [showif [ALPHABET]=18][text show=f]DIGIT_[index]=r[/text][/showif]>> [showif [ALPHABET]=19][text show=f]DIGIT_[index]=s[/text][/showif]>> [showif [ALPHABET]=20][text show=f]DIGIT_[index]=t[/text][/showif]>> [showif [ALPHABET]=21][text show=f]DIGIT_[index]=u[/text][/showif]>> [showif [ALPHABET]=22][text show=f]DIGIT_[index]=v[/text][/showif]>> [showif [ALPHABET]=23][text show=f]DIGIT_[index]=w[/text][/showif]>> [showif [ALPHABET]=24][text show=f]DIGIT_[index]=x[/text][/showif]>> [showif [ALPHABET]=25][text show=f]DIGIT_[index]=y[/text][/showif]>> [showif [ALPHABET]=26][text show=f]DIGIT_[index]=z[/text][/showif]>> [/showif]>> [text >>show=f]DIGIT_[index]=[interpret][DIGIT_[index]][/interpret][/text]>>[/loop]>>>>[loop >>start=1&end=[how_many_characters]][interpret][DIGIT_[index]][/ >>interpret][/loop]
>>>-- Brian Fries, BrainScan Software -- http://www.brainscansoftware.com > -->>>------------------------------------------------------------->This message is sent to you because you are subscribed to> the mailing list .>To unsubscribe, E-mail to: >To switch to the DIGEST mode, E-mail to >Web Archive of this list is at: http://webdna.smithmicro.com/-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
"Dan Strong"
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
CSS in HTML emails? (2003)
[OT] Xserve (2002)
[BULK] [WebDNA] [BULK] Rename a file (2011)
Web Catalog 2 demo (1997)
Search inside Include (1998)
Unix Timestamp using WebDNA [code req] (2003)
[isfile] ? (1997)
Affiliate Marketing Question #2 (1998)
Error Lob.db records error message not name (1997)
Reading Field (2003)
Price Change (2000)
WebCat2b13MacPlugIn - More limits on [include] (1997)
writing checkboxes to a database (2000)
FCKeditor (2008)
Number searching/formats (1998)
Meet your competition (2000)
WC1.6 to WC2 date formatting (1997)
[FoundItems] solved - thanks (1997)
Another Large Database Questions (1997)
RE: Help name our technology! (1997)