summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-02-02 04:46:33 +0000
committerfukachan <fukachan>2003-02-02 04:46:33 +0000
commit316cffaa8ae127f49f452b92d13f182469dc6ff9 (patch)
tree287da320c551d90ae0d237daf9f232c2acf509b8 /fml/lib
parent01ec1512138004075bd8b8b8a8620a82d88a0ea6 (diff)
downloadfml8-316cffaa8ae127f49f452b92d13f182469dc6ff9.tar.gz
fml8-316cffaa8ae127f49f452b92d13f182469dc6ff9.tar.bz2
fml8-316cffaa8ae127f49f452b92d13f182469dc6ff9.zip
adapter for Crypt::UnixCrypt module
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/FML/Crypt.pm89
1 files changed, 89 insertions, 0 deletions
diff --git a/fml/lib/FML/Crypt.pm b/fml/lib/FML/Crypt.pm
new file mode 100644
index 00000000..77945520
--- /dev/null
+++ b/fml/lib/FML/Crypt.pm
@@ -0,0 +1,89 @@
+n#-*- perl -*-
+#
+# Copyright (C) 2003 Ken'ichi Fukamachi
+# All rights reserved. This program is free software; you can
+# redistribute it and/or modify it under the same terms as Perl itself.
+#
+# $FML: @template.pm,v 1.7 2003/01/01 02:06:22 fukachan Exp $
+#
+
+package FML::Crypt;
+use strict;
+use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
+use Carp;
+
+=head1 NAME
+
+FML::Crypt - crypt library
+
+=head1 SYNOPSIS
+
+ use FML::Crypt;
+ my $crypt = new FML::Crypt;
+ my $p_input = $crypt->unix_crypt($text, $salt)
+
+=head1 DESCRIPTION
+
+FML::Crypt is an adapter layer for crypt libraries.
+Now FML::Crypt is just a wrapper for Crypt::UnixCrypt module.
+
+=head1 METHODS
+
+=head2 C<new()>
+
+construcotor.
+
+=cut
+
+
+# Descriptions: construcotor.
+# Arguments: OBJ($self)
+# Side Effects: one
+# Return Value: OBJ
+sub new
+{
+ my ($self) = @_;
+ my ($type) = ref($self) || $self;
+ my $me = {};
+ return bless $me, $type;
+}
+
+
+# Descriptions: unix crypt(3).
+# Arguments: OBJ($self) STR($text) STR($salt)
+# Side Effects: none
+# Return Value: STR
+sub unix_crypt
+{
+ my ($self, $text, $salt) = @_;
+
+ # always use this module's crypt
+ use Crypt::UnixCrypt;
+ return Crypt::UnixCrypt::crypt($text, $salt);
+}
+
+
+=head1 CODING STYLE
+
+See C<http://www.fml.org/software/FNF/> on fml coding style guide.
+
+=head1 AUTHOR
+
+Ken'ichi Fukamachi
+
+=head1 COPYRIGHT
+
+Copyright (C) 2003 Ken'ichi Fukamachi
+
+All rights reserved. This program is free software; you can
+redistribute it and/or modify it under the same terms as Perl itself.
+
+=head1 HISTORY
+
+FML::Crypt appeared in fml8 mailing list driver package.
+See C<http://www.fml.org/> for more details.
+
+=cut
+
+
+1;