Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.442 and 1.443

version 1.442, 2003/11/08 05:45:50 version 1.443, 2003/11/10 20:27:32
Line 4182  sub numval { Line 4182  sub numval {
 }  }
   
 sub latest_rnd_algorithm_id {  sub latest_rnd_algorithm_id {
     return '64bit';      return '64bit2';
 }  }
   
 sub rndseed {  sub rndseed {
Line 4199  sub rndseed { Line 4199  sub rndseed {
     my $CODE=$ENV{'scantron.CODE'};      my $CODE=$ENV{'scantron.CODE'};
     if (defined($CODE)) {      if (defined($CODE)) {
  &rndseed_CODE_64bit($symb,$courseid,$domain,$username);   &rndseed_CODE_64bit($symb,$courseid,$domain,$username);
       } elsif ($which eq '64bit2') {
    return &rndseed_64bit2($symb,$courseid,$domain,$username);
     } elsif ($which eq '64bit') {      } elsif ($which eq '64bit') {
  return &rndseed_64bit($symb,$courseid,$domain,$username);   return &rndseed_64bit($symb,$courseid,$domain,$username);
     }      }
Line 4242  sub rndseed_64bit { Line 4244  sub rndseed_64bit {
     }      }
 }  }
   
   sub rndseed_64bit2 {
       my ($symb,$courseid,$domain,$username)=@_;
       {
    use integer;
    # strings need to be an even # of cahracters long, it it is odd the
           # last characters gets thrown away
    my $symbchck=unpack("%32S*",$symb.' ') << 21;
    my $symbseed=numval($symb) << 10;
    my $namechck=unpack("%32S*",$username.' ');
   
    my $nameseed=numval($username) << 21;
    my $domainseed=unpack("%32S*",$domain.' ') << 10;
    my $courseseed=unpack("%32S*",$courseid.' ');
   
    my $num1=$symbchck+$symbseed+$namechck;
    my $num2=$nameseed+$domainseed+$courseseed;
    #&Apache::lonxml::debug("$symbseed:$nameseed;$domainseed|$courseseed;$namechck:$symbchck");
    #&Apache::lonxml::debug("rndseed :$num:$symb");
    return "$num1,$num2";
       }
   }
   
 sub rndseed_CODE_64bit {  sub rndseed_CODE_64bit {
     my ($symb,$courseid,$domain,$username)=@_;      my ($symb,$courseid,$domain,$username)=@_;
     {      {
  use integer;   use integer;
  my $symbchck=unpack("%32S*",$symb) << 16;   my $symbchck=unpack("%32S*",$symb.' ') << 16;
  my $symbseed=numval($symb);   my $symbseed=numval($symb);
  my $CODEseed=numval($ENV{'scantron.CODE'}) << 16;   my $CODEseed=numval($ENV{'scantron.CODE'}) << 16;
  my $courseseed=unpack("%32S*",$courseid);   my $courseseed=unpack("%32S*",$courseid.' ');
  my $num1=$symbseed+$CODEseed;   my $num1=$symbseed+$CODEseed;
  my $num2=$courseseed+$symbchck;   my $num2=$courseseed+$symbchck;
  #&Apache::lonxml::debug("$symbseed:$CODEseed|$courseseed:$symbchck");   #&Apache::lonxml::debug("$symbseed:$CODEseed|$courseseed:$symbchck");
Line 4393  sub mod_perl_version { Line 4417  sub mod_perl_version {
   
 sub correct_line_ends {  sub correct_line_ends {
     my ($result)=@_;      my ($result)=@_;
     &logthis("Wha $result");  
     $$result =~s/\r\n/\n/mg;      $$result =~s/\r\n/\n/mg;
     $$result =~s/\r/\n/mg;      $$result =~s/\r/\n/mg;
 }  }
Line 4401  sub correct_line_ends { Line 4424  sub correct_line_ends {
   
 sub goodbye {  sub goodbye {
    &logthis("Starting Shut down");     &logthis("Starting Shut down");
 #not converted to using infrastruture  #not converted to using infrastruture and probably shouldn't be
    &logthis(sprintf("%-20s is %s",'%homecache',scalar(%homecache)));  
    &logthis(sprintf("%-20s is %s",'%badServerCache',scalar(%badServerCache)));     &logthis(sprintf("%-20s is %s",'%badServerCache',scalar(%badServerCache)));
    &logthis(sprintf("%-20s is %s",'%metacache',scalar(%metacache)));  
 #converted  #converted
      &logthis(sprintf("%-20s is %s",'%metacache',scalar(%metacache)));
      &logthis(sprintf("%-20s is %s",'%homecache',scalar(%homecache)));
    &logthis(sprintf("%-20s is %s",'%titlecache',scalar(%titlecache)));     &logthis(sprintf("%-20s is %s",'%titlecache',scalar(%titlecache)));
    &logthis(sprintf("%-20s is %s",'%courseresdatacache',scalar(%courseresdatacache)));     &logthis(sprintf("%-20s is %s",'%courseresdatacache',scalar(%courseresdatacache)));
 #1.1 only  #1.1 only

Removed from v.1.442  
changed lines
  Added in v.1.443


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>