->> Very good! Another couple of lines would allow including numbers
->> as well.
DW> Yes. But first we'd have to answer the deep philosophical question of
DW> how the decision would be made whether each character is a letter or a
DW> numerical digit. If it's random, would the relative probabilities be
DW> 26:10, or maybe 1:1 ? The easiest coding, in these two cases, would be
DW> quite different!
Howdy David,
If you have an eight letter password I think 26^8 is the expression for the
number of possible combinations. If numbers are included 36^8 is possible.
You have 10 chances out of 36 that a number will appear in each character
position.
The odds are such that at least one number will usually appear. But because
it's random, eight numbers may occur.
Passwords on BBS's and InterNet usually also include dashes (-), Underlines
(_), periods (.), and some other punctuation characters.
If you wish to ensure a number will occur and also limit how many of them
appear, then the algorythm does get a little messy.
FOR X% = 1 TO 8
IF INSTR("0123456789", (MID$(Pass$, X%, 1)) THEN Cnt% = Cnt% + 1
NEXT X%
LOOP UNTIL Cnt% > 1 AND Cnt < 4
Would be be a way to check.
Chris
--- FMail 0.96â
---------------
* Origin: BIZynet - Worldwide Business via the E-Ways (1:15/55.1)
|