Hah! No sweat.

Same as before, but in addition to the previous rules:
  • X = Alpha
  • 9 = Numeric
  • L = Alphanumeric
  • * = Special char
I've used "*" rather than "$" as it is more KiX-friendly
Break ON
 
SRnd(@MSECS) ; You should use a better seed than this one
$=Rnd(1) ; Discard low random
 
$s="X9L*"
$s "=" funStrongRandom($s) ?
 
Function funStrongRandom($sPasswordMask)
$asClasses="ABCDEFGHIJKLMNOPQRSTUVWXYZ","1234567890","!£$$%%^&*()-_=+[]{};:'@@#~,<.>/?\|"
$funStrongRandom="" ; Initialise as string
 
While $sPasswordMask
$iClass=InStr("1234567\X9L*",Left($sPasswordMask,1))
Select
Case Left($sPasswordMask,1)='\' ; Use next character explicitly.
$funStrongRandom=$funStrongRandom+SubStr($sPasswordMask,2,1)
$sPasswordMask=SubStr($sPasswordMask,2)
Case $iClass
$sPossibles=IIF($iClass & 1,$asClasses[0],"")
$sPossibles=$sPossibles+IIF($iClass & 2,$asClasses[1],"")
$sPossibles=$sPossibles+IIF($iClass & 4,$asClasses[2],"")
Do
$sChar=SubStr($sPossibles,1+Rnd(Len($sPossibles)-1),1)
Until $sChar<>Right($funStrongRandom,1)
$funStrongRandom=$funStrongRandom+$sChar
Case "True" ; Use this character explicitly.
$funStrongRandom=$funStrongRandom+Left($sPasswordMask,1)
EndSelect
$sPasswordMask=SubStr($sPasswordMask,2)
Loop
EndFunction


[ 13. November 2003, 16:01: Message edited by: Richard H. ]