Help with C function

  • Thread starter Thread starter Kokie
  • Start date Start date
K

Kokie

I have problem with converting this C Function to VB.NET:

unsigned int GetCRC (char *buff)
{
int pos = 0;
int crc = 0;
while (buff [pos] != '\0')
{
crc ^= ((unsigned int)(unsigned char)(buff [pos]) << (pos % 9)) &
0x0ffff;
pos++;
}
return crc;
}

It uses Bit_Shift_Left which is not supportet in VB.NET

Any help will be appreciated.

Tx,

Kokie
 
It uses Bit_Shift_Left which is not supportet in VB.NET

Yes it is, since version 7.1 (VS 2003).

If you have to use 7.0 you can just multiply by 2^shiftcount.



Mattias
 
Are you just looking for a CRC class? If so, I have written my own one.

Also, the bit shift is available to VB.NET 2003 because I used it to decrypt
the Windows Product ID(?????-?????-?????-?????-?????) a few months back.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top