как-то так:
Код:Function owenCRC16(ByVal buffer As Byte()) As UInt16 Dim crc As UInt16 Dim i As Integer For i = 0 To buffer.Length - 1 Dim b As Byte = buffer(i) Dim j As Integer For j = 1 To 8 If (0 <> ((b Xor (crc >> 8)) And &H80)) Then crc <<= 1 crc = crc Xor &H8F57 Else crc <<= 1 End If b <<= 1 Next Next owenCRC16 = crc End Function