summaryrefslogtreecommitdiffstats
path: root/data/csum32.pl
blob: dcf4cb2b3882c6a3382a4729c6c516c3988f5581 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl

use bytes;

$c = 0;

while (read(STDIN, $data, 4096) > 0) {
    foreach $b (unpack("N*", $data)) {

	$c = ($c + $b) & 0xffffffff;
    }
}

printf "%08x\n", $c;