CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2002
    Posts
    5

    Regarding check sum algos.

    i need implementaion for
    CRC_16 , CRC_32 and CCITT algorithms in c/c++ (Unix as operating system). I have searched a lot bt still hardly find any.

    thanx in advance
    omerash...

  2. #2
    Join Date
    May 2000
    Location
    Washington DC, USA
    Posts
    715
    check sum algorithms are very simple to implement. Here is the basic idea..

    assign crc0 = datain ^ crc[4];

    crc[4] <= crc[3];
    crc[3] <= crc[2];
    crc[2] <= crc[4] ^ crc[1];
    crc[1] <= crc[0];
    crc[0] <= crc[4] ^ datain;

    The patern in which you combine the bits and perform the xor comparisons doesn't matter. What matters is you're consistant if you want the CRC value to be consistant. Likewise two crc values from different utilities are likely not to be the same.

    Good luck..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured