| 1 | #!perl | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 200 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 200 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 200 | ▶ | use Getopt::Long; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 200 | ▶ | use POE::Component::Server::IRC::Common qw(mkpasswd); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 200 | my $version; | |||||||||||||||||||||||||||
| 9 | my $md5; | ||||||||||||||||||||||||||||
| 10 | 200 | my $apache; | |||||||||||||||||||||||||||
| 11 | 200 | my $bcrypt; | |||||||||||||||||||||||||||
| 12 | 200 | my $password; | |||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 200 | GetOptions( 'version', \$version, 'md5', \$md5, 'apache', \$apache, | |||||||||||||||||||||||||||
| 15 | 'bcrypt', \$bcrypt, 'password=s', \$password ); | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 200 | ▶ | if ( $version ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | 200 | ▶ | no strict 'vars'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | 0 | ▶ | my $v = defined $VERSION ? $VERSION : 'dev-git'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 20 | 0 | print "$0 - version ", $v, "\n"; | |||||||||||||||||||||||||||
| 21 | 0 | exit 0; | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 200 | ▶ | die "No --password option specified\n" unless $password; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 200 | ▶ | $md5 = 0 if $md5 and $apache; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$md5 and $apache
MC/DC0%0/2
$md5 and $apache
$md5
$apache
Truth table66%2/3
A and B
A= $md5B= $apache
| |||||||||||||||||||||||||||||
| 27 | 200 | ▶ | $apache = $md5 = 0 if $bcrypt; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 200 | my $crypt = mkpasswd( $password, md5 => $md5, apache => $apache, bcrypt => $bcrypt ); | |||||||||||||||||||||||||||
| 30 | 200 | ▶ | print "$crypt\n" if $crypt; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | 200 | exit 0; | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | __END__ | ||||||||||||||||||||||||||||