use strict; # solution: 990644297 my $buffer = "/etc/test2.sh"; my $crc = 0; for (grep $_, split /(.{1,4})/, $buffer) { my $val = sprintf "%02X"x4, map { ord } split //, $_; $crc += hex($val); $crc %= 2**32; } print $crc,$/;
In reply to Re^5: CRC of a string
by keszler
in thread CRC of a string
by Dirk80
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |