sub getChecksum($) { my $in = shift; my $check = 0; $in =~ m/(?:(.)(?{$check += ord($1);}))*^/; return $check; }