This repository has been archived on 2025-11-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
AUTS_OLD/AUTS_ServiceControler/CheckSum.vb
2024-03-11 16:34:21 +08:00

19 lines
490 B
VB.net

Public Class CheckSum
''' <summary>
''' 获取数据包的和校验
''' </summary>
''' <param name="packet">数据包的内容</param>
''' <returns></returns>
Public Shared Function GetPacketCheck(packet() As Byte) As Byte
Dim result As Integer
'当packet的相加综合超过INT_MAX则会异常
For Each b As Byte In packet
result += b
Next
Return CByte(&HFF - (result And &HFF))
End Function
End Class