/[mdap]/protocol/calc.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /protocol/calc.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 12 by dpavlin, Sun Apr 22 22:50:42 2007 UTC revision 13 by dpavlin, Sun Apr 22 22:56:35 2007 UTC
# Line 25  for my $i ( 0 .. length($p) ) { Line 25  for my $i ( 0 .. length($p) ) {
25          printf("# %-2d '%s' %2d %02x -- %2d %02d\n", $i,$c,$o,$o,$sum,$sum);          printf("# %-2d '%s' %2d %02x -- %2d %02d\n", $i,$c,$o,$o,$sum,$sum);
26  }  }
27    
28  printf("checksum: %s == %02x\n", $orig, $sum);  my $xor = 0;
29    map { $xor ^= ord($_) } split(//,$p);
30    
31    printf("checksum: %s == %02x [xor=%02x]\n", $orig, $sum, $xor);

Legend:
Removed from v.12  
changed lines
  Added in v.13

  ViewVC Help
Powered by ViewVC 1.1.26