Password generator: Difference between revisions

Content added Content deleted
Line 3,081: Line 3,081:
}
}


sub char-groups( @exclude )
sub char-groups( @exclude is copy )
{
{
state @special = < $ % & \ ` ~ ! * + , - . / : ; = ? @ ^ _ ~ [ ] ( ) { | } # ' " \< \> >;

my %char-groups =
my %char-groups =
lc => ['a' .. 'z'],
lc => ['a' .. 'z'],
uc => ['A' .. 'Z'],
uc => ['A' .. 'Z'],
digit => ['0' .. '9'],
digit => ['0' .. '9'],
special => ( @special (-) @exclude ).keys;
special => < $ % & \ ` ~ ! * + , - . / : ; = ? @ ^ _ ~ [ ] ( ) { | } # ' " \< \> >;


%char-groups< special >:delete
for %char-groups.keys
{
unless %char-groups< special >;
%char-groups{ $_ } = %char-groups{ $_ } (-) @exclude;
%char-groups{ $_ }:delete unless %char-groups{ $_ };
}


%char-groups;
%char-groups;