Re: Profanity checking, phonetically.
- From: anno4000@xxxxxxxxxxxxxxxxxxxxxx
- Date: 10 Jul 2006 09:18:16 GMT
David Squire <David.Squire@xxxxxxxxxxxxxxxxxxxx> wrote in comp.lang.perl.misc:
shrike@xxxxxxxxxxxxxx wrote:
[snip]
Thanks all. I expected this to be oddball enough not to be in the
cookbook. The previous poster was correct: it is uid/password
combinations that I am checking.
Is this sort of thing common enough to bother adding a module to CPAN?
I expect to write a module specifically for this. I would call it
Text::Soundex::Profanity
-Opinions?
Hmmm. Seems like a lot of work to solve a very rare problem. I generate
random passwords using this:
sub makePassword {
my $PasswordLength = 10;
$PasswordLength = shift if @_;
my @Chars = split //,
'abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789'; # note
excision of ambiguous characters
my $Password = '';
for (1..$PasswordLength) {
$Password .= $Chars[rand @Chars];
}
return $Password;
}
That's improvable. The generation of the character array can be taken
out of the sub so it doesn't happen each time the sub is called. The
remainder can be compacted:
{
# note excision of ambiguous characters
my @Chars = split //,
'abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789';
sub makePassword {
return join '', @Chars[ map rand @Chars, 1 .. shift || 10];
}
}
.. which I picked up somewhere (here?) a few years ago and adapted. I
have yet to see one that looked pronounceable, let alone profane.
Like with all safety measures, the impact of a breach must be weighed
against the expenditure of implementation. If you are running a porn
site your conclusion may be different than when you represent the
holy see.
Anno
.
- References:
- Profanity checking, phonetically.
- From: shrike@xxxxxxxxxxxxxx
- Re: Profanity checking, phonetically.
- From: Sherm Pendley
- Re: Profanity checking, phonetically.
- From: shrike@xxxxxxxxxxxxxx
- Re: Profanity checking, phonetically.
- From: David Squire
- Profanity checking, phonetically.
- Prev by Date: Problem converting euro from windows-1252 to UTF-8 !!
- Next by Date: Re: converting line input into columns
- Previous by thread: Re: Profanity checking, phonetically.
- Next by thread: Re: Profanity checking, phonetically.
- Index(es):