|
-
Dec 6th, 2000, 07:24 AM
#1
Thread Starter
Lively Member
Help.
I am struggling to convert this piece of C code to VB.
#define updcrc(d,s) (crctab[((s >> 8) & 0xff)] ^ (s << 8) ^ d)
This is what I have so far
Public Sub UpdCRC(Char As Integer, Sum As Long)
Sum = m_lCRCTable(ShiftRight(Sum, 8) And 255) Xor (ShiftLeft(Sum, 8)) Xor Char
End Sub
Private Function ShiftLeft(Word As Long, Bits As Integer) As Long
ShiftLeft = (Word * (2 ^ Bits)) And 65535
End Function
Private Function ShiftRight(Word As Long, Bits As Integer) As Long
ShiftRight = (Word / (2 ^ Bits)) And 65535
End Function
Can anybody help ???
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|