Add system stack

This commit is contained in:
世界 2022-09-06 19:24:47 +08:00
parent 0efafc9963
commit 2f15b0cd3f
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
26 changed files with 1713 additions and 79 deletions

View file

@ -0,0 +1,14 @@
package clashtcpip
func SumCompat(b []byte) (sum uint32) {
n := len(b)
if n&1 != 0 {
n--
sum += uint32(b[n]) << 8
}
for i := 0; i < n; i += 2 {
sum += (uint32(b[i]) << 8) | uint32(b[i+1])
}
return
}