Guest User

Untitled

a guest
Dec 4th, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. Function CRC(ByVal bData() As Byte, ByVal iLength As Integer, ByVal iPolynome As Integer, ByVal iCRC As Integer)
  2. Dim flag As Boolean
  3. For i As Integer = 0 To iLength - 1
  4. iCRC = iCRC Xor bData(i)
  5. For j = 0 To 7
  6. If (iCRC And &H1) = 1 Then flag = True Else flag = False
  7. iCRC = iCRC \ 2
  8. If flag Then iCRC = iCRC Xor iPolynome
  9. Next
  10. Next
  11. Return Hex(iCRC And &HFFFF)
  12. End Function
Advertisement
Add Comment
Please, Sign In to add comment