Hi;
I found this code on some websites, but I don't know how to check if it is
right or wrong.
Given that;
UINT16 = unsigned int
UINT8 = unsigned char
The require CRC is the CRC16-CCITT
UINT16 crcByte(UINT16 crc, UINT8 b)
{
UINT8 t = 8;
crc = crc ^ b << 8;
do
{
if (crc & 0x8000)
crc = crc << 1 ^ 0x1021;
else
crc = crc << 1;
}while (--t);
return crc;
}
Thanks and Best Regards
Mohsen
On Fri, Mar 27, 2009 at 7:51 AM, Thomas Hruska <[email protected]>wrote:
> Mohsen Deeb wrote:
> > Hi Guys;
> >
> > Can anyone help with CRC-CCITT implementation or clear doc?
> >
> > Thanks and best regards
> >
> > Mohsen Deeb
> >
> >
> > [Non-text portions of this message have been removed]
>
> I assume the file you attached that contained your attempt at this
> homework assignment was what was removed from your e-mail. This group
> doesn't accept file attachments. You'll have to copy and paste your code.
>
> There are a zillion different CRC-16 algorithms out there. Most have
> been eliminated. CCITT is a specific implementation and I know there is
> source code out there for it because I've written a few CRC
> implementations before. Did you search Google?
>
> --
> Thomas Hruska
> CubicleSoft President
> Ph: 517-803-4197
>
> *NEW* MyTaskFocus 1.1
> Get on task. Stay on task.
>
> http://www.CubicleSoft.com/MyTaskFocus/
>
>
>
[Non-text portions of this message have been removed]