Hi,

I am coverting a CRC function from C++ to VB. There is bitwise and shifing and I am not sure if I am using VB correctly for this. The CRC works in the C++ code but not in VB.

Below is pasted the C++ version and the VB.

Any suggestions would be appreciated.

Thanks

Jeff

C++ Version

bitmask = 1 << 7;

do

{

if (!(runCRC & 0x8000) ^ !(aChar & bitmask))

{

runCRC <<= 1;

runCRC ^= CRC_Poly;

}

else

runCRC <<= 1;

} while (bitmask >>= 1);

VB Version

bitMask = 1 << 7

Do

If (Not (runCRC And &H8000) Xor (Not ((byteValue) And bitMask))) Then

runCRC <<= 1

runCRC = (runCRC Xor CRC_Poly)

Else

runCRC <<= 1

End If

bitMask >>= 1

Loop Until (bitMask = 1)