* Copyright (c) 1991 The Regents of the University of California.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)sum1.c 5.1 (Berkeley) %G%";
* 16-bit checksum, rotating right before each addition;
while ((nr
= read(fd
, buf
, sizeof(buf
))) > 0)
for (total
+= nr
, p
= buf
; nr
--; ++p
) {
crc
= ((crc
>> 1) + *p
) & 0xffff;