[comp.unix.questions] Sum history

dce@mips.COM (David Elliott) (02/02/88)

Does anyone know why sum on System V-based systems produces
different results by default than sum on BSD-based systems?

I notice also that System V sum has a -r option for using an
alternate algorithm, which generates the same results as the
BSD sum.

-- 
David Elliott		dce@mips.com  or  {ames,prls,pyramid,decwrl}!mips!dce

gwyn@brl-smoke.ARPA (Doug Gwyn ) (02/08/88)

In article <1451@quacky.mips.COM> dce@mips.COM (David Elliott) writes:
>Does anyone know why sum on System V-based systems produces
>different results by default than sum on BSD-based systems?

Because they evolved by different paths (but I bet you knew that).
I think somebody decided that "sums the bytes in a file" should be
taken literally.

>I notice also that System V sum has a -r option for using an
>alternate algorithm, which generates the same results as the
>BSD sum.

Yes, use that flavor for checksum purposes.

lvc@tut.cis.ohio-state.edu (Lawrence V. Cipriani) (02/09/88)

In article <7222@brl-smoke.ARPA> gwyn@brl.arpa
	(Doug Gwyn (VLD/VMB) <gwyn>) writes:

>Yes, use that flavor for checksum purposes.
	(Doug was speaking of sum -r here)

Though this is much better than just summing up the bytes, it
hardly qualifies as a good checksum.  It is easy to find different
sequences of numbers that generate the same "sum -r" (if you know
the algorithm).  It is not a crc if that is what you are looking for.
There were some crc codes floating around on Usenet once, but
I don't have them now.

-- 
oo
Larry Cipriani, AT&T Networks Systems (by day) Ohio State University (by night)
Domain: lvc@tut.cis.ohio-state.edu
Path: ...!cbosgd!osu-cis!tut.cis.ohio-state.edu!lvc (yes its right)