Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor improvements.

  • Loading branch information...
commit 7571634ed01505642323886dca48283df0181980 1 parent 8d73f5d
dcarrera authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 module-management/Fletcher.pl
6 module-management/Fletcher.pl
View
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.