Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function CRC(ByVal bData() As Byte, ByVal iLength As Integer, ByVal iPolynome As Integer, ByVal iCRC As Integer)
- Dim flag As Boolean
- For i As Integer = 0 To iLength - 1
- iCRC = iCRC Xor bData(i)
- For j = 0 To 7
- If (iCRC And &H1) = 1 Then flag = True Else flag = False
- iCRC = iCRC \ 2
- If flag Then iCRC = iCRC Xor iPolynome
- Next
- Next
- Return Hex(iCRC And &HFFFF)
- End Function
Advertisement
Add Comment
Please, Sign In to add comment