line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::MySQL; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
155166
|
use strict; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
263
|
|
4
|
4
|
|
|
4
|
|
23
|
use vars qw($VERSION @ISA @EXPORT_OK); |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
314
|
|
5
|
4
|
|
|
4
|
|
3924
|
use Digest::SHA1 qw(sha1 sha1_hex); |
|
4
|
|
|
|
|
6259
|
|
|
4
|
|
|
|
|
733
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
BEGIN { |
8
|
4
|
|
|
4
|
|
9
|
$VERSION = '0.04'; |
9
|
4
|
50
|
|
|
|
20
|
if ($] > 5.006) { |
10
|
4
|
|
|
|
|
31
|
require XSLoader; |
11
|
4
|
|
|
|
|
2608
|
XSLoader::load(__PACKAGE__, $VERSION); |
12
|
|
|
|
|
|
|
} else { |
13
|
0
|
|
|
|
|
0
|
require DynaLoader; |
14
|
0
|
|
|
|
|
0
|
@ISA = qw(DynaLoader); |
15
|
0
|
|
|
|
|
0
|
__PACKAGE__->bootstrap; |
16
|
|
|
|
|
|
|
} |
17
|
4
|
|
|
|
|
45
|
require Exporter; |
18
|
4
|
|
|
|
|
40
|
push @ISA, 'Exporter'; |
19
|
4
|
|
|
|
|
398
|
@EXPORT_OK = qw(password password41); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
0
|
1240
|
sub password41($) { "*".uc(sha1_hex(sha1($_[0]))); } |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
__END__ |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 NAME |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Crypt::MySQL - emulate MySQL PASSWORD() function. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 SYNOPSIS |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
use Crypt::MySQL qw(password password41); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
my $encrypted = password("foobar"); # for MySQL 3.23, 4.0 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
my $encrypted = password41("foobar"); # for MySQL 4.1 or later. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 DESCRIPTION |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Crypt::MySQL emulates MySQL PASSWORD() SQL function, without libmysqlclient. |
42
|
|
|
|
|
|
|
You can compare encrypted passwords, without real MySQL environment. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 AUTHOR |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
IKEBE Tomohiro E<lt>ikebe@shebang.jpE<gt> |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
49
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 SEE ALSO |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
L<DBD::mysql> L<Digest::SHA1> |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |