in article 20094@palm-dev-forum, Eric at [EMAIL PROTECTED] wrote on 7/8/00 3:50
AM:
> is it possible to take a checksum of parts or even whole of the
> code? if possible, I can prevent my code get corrupt.
Without getting into a discussion of the merits or otherwise of doing so,
here's the code:
UInt16 ComputeChecksum (UInt16 seed)
{
MemHandle hRes;
MemPtr pRes;
UInt16 size, checksum;
hRes = DmGetResource ('code', 1);
size = MemHandleSize (hRes);
pRes = MemHandleLock (hRes);
checksum = Crc16CalcBlock (pRes, size, seed);
MemHandleUnlock (hRes);
DmReleaseResource (hRes);
return checksum;
}
Stephen Best
Bitware Australia
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/
- can I checksum by part or whole of my code? Eric
- Re: can I checksum by part or whole of my code? Adam Wozniak
- Re: can I checksum by part or whole of my code? krollin
- Re: can I checksum by part or whole of my code? Brian Mathis
- Re: can I checksum by part or whole of my code? Eric
- Re: can I checksum by part or whole of my code? Aaron Ardiri
- Re: can I checksum by part or whole of my code? Adam Wozniak
- Re: can I checksum by part or whole of my code? Stephen Best
- Re: can I checksum by part or whole of my code? Aaron Ardiri
- Re: can I checksum by part or whole of my code? Adam Wozniak
- Re: can I checksum by part or whole of my code? Aaron Ardiri
- Re: can I checksum by part or whole of my code? Adam Wozniak
- Re: can I checksum by part or whole of my code? Michael S. Davis
- Re: can I checksum by part or whole of my code? Aaron Ardiri
- Re: can I checksum by part or whole of my code? Aaron Ardiri
- RE: can I checksum by part or whole of my code? Nesse, Rustin
- RE: can I checksum by part or whole of my code? Aaron Ardiri
- RE: can I checksum by part or whole of my code? Nesse, Rustin
