Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!linus!philabs!cmcl2!seismo!harvard!talcott!panda!genrad!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.news Subject: Re: Suggestion for checksum on articles Message-ID: <2464@sun.uucp> Date: Sun, 21-Jul-85 18:47:42 EDT Article-I.D.: sun.2464 Posted: Sun Jul 21 18:47:42 1985 Date-Received: Wed, 24-Jul-85 07:26:24 EDT References: <514@oliveb.UUCP> Distribution: net Organization: Sun Microsystems, Inc. Lines: 35 > The only hard part of this comming up with a checksum that is portable > across the wide varity of machines on the net. Given that the vast majority of UUCP connections on USENET run over serial lines using the checksummed "g" protocol, I think we have an existence proof for such a protocol. We may not want to use that protocol, though, due to 1) trade secret restrictions, although Lauren Weinstein could just tell us what the algorithm is and 2) the fact that at least some implementations of it within UUCP don't compile into correct code with some C compilers. To make the checksum portable: 1) always checksum bytes, not anything larger - but since we're processing text here, it's unlikely that anybody'd go through the trouble to accumulate two bytes and do checksumming on two- byte quantities. 2) don't use "native" arithmetic operations like addition and subtraction; there is, I believe, at least one Univac 1100 on the net and it's a one's-complement machine. 3) don't assume that characters are signed or that they're unsigned - there are lots of signed-character VAXes on the net and there are lots of unsigned-character 3Bs on the net. 4) don't assume that casts will be done in the order you think they will - I believe that was the cause of lots of porting problems for the UUCP "g" protocol checksum code. Guy Harris