Permalink
Browse files

Minor improvements.

  • Loading branch information...
1 parent 8d73f5d commit 7571634ed01505642323886dca48283df0181980 dcarrera committed Jun 1, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 module-management/Fletcher.pl
@@ -48,16 +48,16 @@ ($val is rw)
my $hex = '';
while $val {
my $tmp = $val % 16;
- $val = int $val/16;
+ $val = int($val/16);
$hex = ($tmp < 10 ?? $tmp !! chr (97 - 10 + $tmp)) ~ $hex;
}
return $hex;
}
sub fletcher16($str) {
my ($A,$B) = (0,0);
- for map { .ord }, $str.split('') -> $val {
+ for map { .ord }, $str.comb -> $val {
if $val > 255 {
- $A = ($A + int $val/255) % 255;
+ $A = ($A + int($val/255)) % 255;
$B = ($B + $A) % 255;
}
$A = ($A + $val % 255) % 255;

0 comments on commit 7571634

Please sign in to comment.