[Coco] Ambiguous code
Stephen H. Fischer
SFischer1 at Mindspring.com
Thu Sep 25 16:50:53 EDT 2008
Years ago I did some comparisons between the CRC32 values generated by OS-9
and MSDOS for the same files.
The code I had generated the same values. And matched other software
generated values from various MSDOS programs.
This of course takes a lot more computing to generate than the checksum
calculation.
Stephen H. Fischer
----- Original Message -----
From: "Bill Barnes" <da3m0n_slay3r at yahoo.com>
To: <coco at maltedmedia.com>
Sent: Thursday, September 25, 2008 9:59 AM
Subject: Re: [Coco] Ambiguous code
> This code looks like a simple checksum, no CRC, nothing fancy but a full
> sum of every value stored in a string [OK, an Array of characters] or a
> partial string as the pointer could be in the middle of an arry, while
> count specifies how much to read in and add (whole, part, even potentially
> past the end).
>
> since it is just one function of I don't know how many, I'm not sure of
> its application in the broader scope. (Drivewire?)
>
>
>> > This sample code you provide for the checksum
>> calculation is
>> > ambiguous:
>> >
>> > int calChecksum(char *ptr, int count)
>> > {
>> > short Checksum = 0;
>> > while(--count)
>> > {
>> > Checksum += *(ptr++);
>> > }
>> > return (Checksum);
>> > }
More information about the Coco
mailing list