Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Nov 1998 17:17:14 -0600
From:      dannyman <dannyman@dannyland.org>
To:        ee123@rocketmail.com, freebsd-hackers@FreeBSD.ORG
Subject:   Re: Password generator
Message-ID:  <19981120171714.P14320@enteract.com>
In-Reply-To: <19981120163916.17293.rocketmail@web1.rocketmail.com>; from EE on Fri, Nov 20, 1998 at 08:39:16AM -0800
References:  <19981120163916.17293.rocketmail@web1.rocketmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 20, 1998 at 08:39:16AM -0800, EE wrote:
>   Hy,
> I'm looking for a password generator.
> Does anybody know where I can found one?

Perl code snippet:

sub get_password {
	my @ary = ( 0 .. 9, 'A' .. 'Z', 'a' .. 'z', 'z', '!', '$', '%');
	my $password;
	my $pw_len = rand(5)+6;
	for(1..$pw_len) {
		$password .= $ary[rand(@ary)];
	}
	return $password;
}

This is actually a labotomised function call that's part of a script I wrote
to add users to our system.  It generates a random password if the user
doesn't supply one.

-danny

-- 
  //       dannyman yori aiokomete       ||  Our Honored Symbol deserves
\\/ http://www.dannyland.org/~dannyman/  ||  an Honorable Retirement (UIUC)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19981120171714.P14320>