function GeraSenhaHex(Digitos: Integer; Min: Boolean; Mai: Boolean; Num: Boolean): string;
const
MinC = 'abcdef';
MaiC = 'ABCDEF';
NumC = '1234567890';
var
p, q : Integer;
Char, Senha: String;
begin
Char := '';
If Min then Char := Char + MinC;
If Mai then Char := Char + MaiC;
If Num then Char := Char + NumC;
for p := 1 to Digitos do
begin
Randomize;
q := Random(Length(Char)) + 1;
Senha := Senha + Char[q];
end;
Result := Senha;
end;
const
MinC = 'abcdef';
MaiC = 'ABCDEF';
NumC = '1234567890';
var
p, q : Integer;
Char, Senha: String;
begin
Char := '';
If Min then Char := Char + MinC;
If Mai then Char := Char + MaiC;
If Num then Char := Char + NumC;
for p := 1 to Digitos do
begin
Randomize;
q := Random(Length(Char)) + 1;
Senha := Senha + Char[q];
end;
Result := Senha;
end;
0 comentários:
Postar um comentário