I am strugling with a crc calculator.
I have found the C++ code, but I want to convert it into VB .NET language.
Is there anyone who can help me? Original link:
HTML Code:
http://ghsi.de/index.php?option=com_wrapper&Itemid=151
The loops and so I understand, but i don't know what to do with :
- DoInvert = ('1'==BitString[i]) ^ CRC[7];
- CRC[5] = CRC[4] ^ DoInvert;

C++ code :
Code:
char *MakeCRC(char *BitString)
   {
   static char Res[9];                                 // CRC Result
   char CRC[8];
   int  i;
   char DoInvert;
   
   for (i=0; i<8; ++i)  CRC[i] = 0;                    // Init before calculation
   
   for (i=0; i<strlen(BitString); ++i)
      {
      DoInvert = ('1'==BitString[i]) ^ CRC[7];         // XOR required?

      CRC[7] = CRC[6];
      CRC[6] = CRC[5];
      CRC[5] = CRC[4] ^ DoInvert;
      CRC[4] = CRC[3] ^ DoInvert;
      CRC[3] = CRC[2];
      CRC[2] = CRC[1];
      CRC[1] = CRC[0];
      CRC[0] = DoInvert;
      }
      
   for (i=0; i<8; ++i)  Res[7-i] = CRC[i] ? '1' : '0'; // Convert binary to ASCII
   Res[8] = 0;                                         // Set string terminator

   return(Res);
   }
Thank you in advance