初始化提交
仓库转移到Gitea,初始化提交,可能丢失以前的git版本日志
This commit is contained in:
18
AUTS_ServiceControler/CheckSum.vb
Normal file
18
AUTS_ServiceControler/CheckSum.vb
Normal file
@@ -0,0 +1,18 @@
|
||||
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
|
||||
Reference in New Issue
Block a user