home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-perl-addon-1.4.9-installer.exe / MD5_Base64.pm < prev    next >
Encoding:
Perl POD Document  |  2003-12-11  |  1.8 KB  |  94 lines

  1. package CGI::Session::ID::MD5_Base64;
  2.  
  3. # $Id: MD5_Base64.pm_rev 1.3 2003/12/11 16:32:43 root Exp root $
  4.  
  5. use strict;
  6. use Digest::MD5;
  7.  
  8. use vars qw( $VERSION );
  9.  
  10.     $VERSION = '1.01';
  11.  
  12. sub generate_id {
  13.     my $self = shift;
  14.     my $md5 = new Digest::MD5();
  15.     $md5->add( $$ , time() , rand(9999) );
  16.     return $md5->b64digest();
  17. }
  18.  
  19.  
  20. 1;
  21.  
  22. =pod
  23.  
  24. =head1 NAME
  25.  
  26. CGI::Session::ID::MD5_Base64 - CGI::Session ID driver based on Base64 encoding
  27.  
  28. =head1 SYNOPSIS
  29.  
  30.     use CGI::Session;
  31.  
  32.     $session = new CGI::Session("id:MD5_Base64", undef, { Directory => '/tmp' };
  33.  
  34. =head1 DESCRIPTION
  35.  
  36. CGI::Session::ID::MD5_Base64 is to generate MD5 digest Base64 encoded random ids.
  37. The library does not require any arguments. 
  38.  
  39. =head1 COPYRIGHT
  40.  
  41. Copyright (C) 2003 Daniel Peder. All rights reserved.
  42.  
  43. This library is free software. You can modify and distribute it under the same terms as Perl itself.
  44.  
  45. Partialy based on CGI::Session::ID::MD5 and the whole excelent CGI::Session work by
  46.  
  47. Sherzod Ruzmetov <sherzodr@cpan.org>
  48.  
  49. =head1 AUTHOR
  50.  
  51. Daniel Peder <danpeder@cpan.org>
  52.  
  53. Feedbacks, suggestions and patches are welcome.
  54.  
  55. =head1 SEE ALSO
  56.  
  57. =over 4
  58.  
  59. =item *
  60.  
  61. L<MIME::Base64|MIME::Base64> - Base64 encoding method
  62.  
  63. =item *
  64.  
  65. L<Incr|CGI::Session::ID::Incr> - Auto Incremental ID generator
  66.  
  67. =item *
  68.  
  69. L<CGI::Session|CGI::Session> - CGI::Session manual
  70.  
  71. =item *
  72.  
  73. L<CGI::Session::Tutorial|CGI::Session::Tutorial> - extended CGI::Session manual
  74.  
  75. =item *
  76.  
  77. L<CGI::Session::CookBook|CGI::Session::CookBook> - practical solutions for real life problems
  78.  
  79. =item *
  80.  
  81. B<RFC 2965> - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt
  82.  
  83. =item *
  84.  
  85. L<CGI|CGI> - standard CGI library
  86.  
  87. =item *
  88.  
  89. L<Apache::Session|Apache::Session> - another fine alternative to CGI::Session
  90.  
  91. =back
  92.  
  93. =cut
  94.