/[cvs]/nfo/perl/libs/Data/UUID/PurePerl.pm
ViewVC logotype

Contents of /nfo/perl/libs/Data/UUID/PurePerl.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Thu Dec 19 16:36:29 2002 UTC (21 years, 6 months ago) by joko
Branch: MAIN
CVS Tags: HEAD
+ added as an alternative to Data::UUID which is written in c language (XS-code) and somehow fails to compile with ActiveState/VC
+ this module utilizes Digest::MD5 which should work without problems on ActiveState, too

1 ## --------------------------------------------------------------------------------
2 ## $Id$
3 ## --------------------------------------------------------------------------------
4 ## $Log$
5 ## --------------------------------------------------------------------------------
6
7
8
9 # derived from:
10 # CGI::Session::ID::MD5 - default CGI::Session ID driver
11 # Id: MD5.pm,v 3.2 2002/11/27 12:30:26 sherzodr Exp
12 # please visit http://search.cpan.org/src/SHERZODR/CGI-Session-3.11/Session/ID/MD5.pm
13
14 package Data::UUID::PurePerl;
15
16 # $Id$
17
18 use strict;
19 use Digest::MD5;
20 use vars qw($VERSION);
21
22 ($VERSION) = '$Revision: 3.2 $' =~ m/Revision:\s*(\S+)/;
23
24 sub generate_id {
25 #my $self = shift;
26
27 my $md5 = new Digest::MD5();
28 $md5->add($$ , time() , rand(9999) );
29
30 return $md5->hexdigest();
31 }
32
33 sub generate_id_blocks {
34 my $count = shift;
35 my @id;
36 for (1..$count) {
37 push @id, generate_id();
38 }
39 my $id = join('-', @id);
40 return $id;
41 }
42
43 1;

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed