[time-nuts] Oncore Checksums

Matthew Smith matt at smiffytech.com
Thu Apr 17 21:51:45 EDT 2008


Quoth Chris Kuethe at 2008-04-18 10:59...
> int
> oncore_checksum(char *buf, int len){
> 	unsigned char a, b;
> 	int i;
> 
> 	a = buf[len-3];
> 	b = '\0';
> 	for(i = 2; i < len - 3; i++)
> 		b ^= buf[i];
> 	if (a == b)
> 		return 0;
> 	return 1;
> }

'Scuse me for being something of a C newbie, but does that not return 
either a 1 or a 0, but not the checksum?

Otherwise, I can follow the logic.  Thanks.


Cheers

M


-- 
Matthew Smith
Smiffytech - Technology Consulting & Web Application Development
Business: http://www.smiffytech.com/
Personal: http://www.smiffysplace.com/
LinkedIn: http://www.linkedin.com/in/smiffy



More information about the time-nuts mailing list