9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@cse.psu.edu
Subject: [9fans] snap checksum
Date: Fri, 11 Jan 2008 14:39:08 -0500	[thread overview]
Message-ID: <0d43ff0b0f3fc5742f94b963c508be10@quanstro.net> (raw)

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


             reply	other threads:[~2008-01-11 19:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-11 19:39 erik quanstrom [this message]
2008-01-12 19:06 Russ Cox
2008-01-12 19:30 ` erik quanstrom
2008-01-16  9:43 ` Douglas A. Gwyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0d43ff0b0f3fc5742f94b963c508be10@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).