CRC CCITT (0xFFFF) calculation on https://www.lammertbies.nl/comm/info/crc-calculation.html
Here is the code:
Private Sub CalculateCRC(Data() As Byte) As Int
Dim i, j As Int
Dim lngCheck As Long
Dim Poly, CRC As Long
Dim TestBit, TestBit1, TestBit2 As Boolean
Poly = 0x1021...