| Crypt-MySQL documentation | Contained in the Crypt-MySQL distribution. |
Crypt::MySQL - emulate MySQL PASSWORD() function.
use Crypt::MySQL qw(password password41);
my $encrypted = password("foobar"); # for MySQL 3.23, 4.0
my $encrypted = password41("foobar"); # for MySQL 4.1 or later.
Crypt::MySQL emulates MySQL PASSWORD() SQL function, without libmysqlclient. You can compare encrypted passwords, without real MySQL environment.
IKEBE Tomohiro <ikebe@shebang.jp>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Crypt-MySQL documentation | Contained in the Crypt-MySQL distribution. |
package Crypt::MySQL; use strict; use vars qw($VERSION @ISA @EXPORT_OK); use Digest::SHA1 qw(sha1 sha1_hex); BEGIN { $VERSION = '0.04'; if ($] > 5.006) { require XSLoader; XSLoader::load(__PACKAGE__, $VERSION); } else { require DynaLoader; @ISA = qw(DynaLoader); __PACKAGE__->bootstrap; } require Exporter; push @ISA, 'Exporter'; @EXPORT_OK = qw(password password41); } sub password41($) { "*".uc(sha1_hex(sha1($_[0]))); } 1; __END__