Noch eine kleine Anregung von mir:
Delphi-Quellcode:
const
cgUcase = 0;
cgLcase = 1;
cgPunct = 2;
MIN_PSWD_LEN = 8;
function IsStrongPassword(s: string): boolean;
var
cGroup: array [cgUcase..cgPunct] of byte;
i: integer;
begin
ZeroMemory(@cGroup, SizeOf(cGroup));
for i := 1 to Length(s) do
case s[i] of
'A'..'Z': Inc(cGroup[cgUcase]);
'a'..'z': Inc(cGroup[cgLcase]);
else Inc(cGroup[cgPunct]);
end;
Result := (Length(s) >= MIN_PSWD_LEN)
and (cGroup[cgUcase] > 0)
and (cGroup[cgLcase] > 0)
and (cGroup[cgPunct] > 0);
end;
Grüße vom marabu