version 1.31, 2000/09/25 20:28:54
|
version 1.32, 2000/09/26 20:07:24
|
Line 996 sub symbread {
|
Line 996 sub symbread {
|
|
|
# ---------------------------------------------------------- Return random seed |
# ---------------------------------------------------------- Return random seed |
|
|
|
sub numval { |
|
my $txt=shift; |
|
$txt=~tr/A-J/0-9/; |
|
$txt=~tr/a-j/0-9/; |
|
$txt=~tr/K-T/0-9/; |
|
$txt=~tr/k-t/0-9/; |
|
$txt=~tr/U-Z/0-5/; |
|
$txt=~tr/u-z/0-5/; |
|
$txt=~s/\D//g; |
|
return int($txt); |
|
} |
|
|
sub rndseed { |
sub rndseed { |
my $symb; |
my $symb; |
unless ($symb=&symbread()) { return ''; } |
unless ($symb=&symbread()) { return ''; } |
|
my $symbchck=unpack("%32C*",$symb); |
|
my $symbseed=numval($symb)%$symbchck; |
|
my $namechck=unpack("%32C*",$ENV{'user.name'}); |
|
my $nameseed=numval($ENV{'user.name'})%$namechck; |
|
return int( $symbseed |
|
.$nameseed |
|
.unpack("%32C*",$ENV{'user.domain'}) |
|
.unpack("%32C*",$ENV{'request.course.uri'}) |
|
.$namechck |
|
.$symbchck); |
} |
} |
|
|
# ------------------------------------------------------------- Declutters URLs |
# ------------------------------------------------------------- Declutters URLs |