3 # This module impliments the verification routines
5 # Copyright (c) 2002 Dirk Koopman G1TLH
16 use Digest::SHA1 qw(sha1_base64);
18 use vars qw($VERSION $BRANCH);
19 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
20 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
21 $main::build += $VERSION;
22 $main::branch += $BRANCH;
27 my $self = bless {}, ref($class) || $class;
38 return $self->{seed} = sha1_base64('RbG4tST2dYPWnh6bfAaq7pPSL04', @_);
44 return $self->{salt} = substr sha1_base64($self->{seed}, rand, rand, rand), 0, 6;
50 return $self->{salt} . sha1_base64($self->{salt}, $self->{seed}, @_);
57 my $p = sha1_base64($self->{salt}, $self->{seed}, @_);
64 return @_ ? $self->{seed} = shift : $self->{seed};
70 return @_ ? $self->{salt} = shift : $self->{salt};