From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <0d43ff0b0f3fc5742f94b963c508be10@quanstro.net> From: erik quanstrom Date: Fri, 11 Jan 2008 14:39:08 -0500 To: 9fans@cse.psu.edu MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] snap checksum Topicbox-Message-UUID: 2baf01c0-ead3-11e9-9d60-3106f5b1d025 does anyone know if the function /sys/src/cmd/snap/take.c:/^sumr can return 0 for a buffer that is not all zeros? i think it can not, since for sum&1, the next sum at least has 0x8000 set and otherwise if (sum&1) == 0, then either sum == 0 or sum>>1 != 0. fletcher-16 seems similar except for the extra sum. does anyone know of any writeups on this algorithm? or at least an example that shows that sum can return 0 for a non-zeroed buffer? - erik