containing upper/lower case and digits.
I created this for personal use,
but feel free to use it if you like.
MsgBox % GenRndStr( 10 )
Return
GenRndStr( Length ) {
If ( Length < 3 || Length > 30 ) {
MsgBox, 0x30,, More than 3 less than 30 Characters!
Return "Error"
}
RndStr := ""
While ( StrLen( RndStr ) < Length ) {
RndArr%a_index% := Rand()
RndStr .= inStr( RndStr, RndArr%a_index% ) ? : ( RndArr%a_index%, Rand() )
}
Return RndStr
}
Rand() {
Random, cTyp, 1, 3
Random cNm, % ( cTyp=1 ? 48 : cTyp=2 ? 65 : 97 ), % ( cTyp=1 ? 57 : cTyp=2 ? 90 : 122 )
Return % Chr( cNm )
}Please let me know if you think its 'strong' enoughand if you see any optimization points.
I purposely left behind some old var arrays
so I know where to clean up.
AHK_L has much better arrays for this so I'm considering adapting it.
I would also like to convert it for PHP.
Ty and nJoy




