1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-12 04:34:32 +08:00

feat: impl. trans & ttl

This commit is contained in:
源文雨
2025-03-13 01:52:35 +09:00
parent 658916268a
commit 6fc45333d8
20 changed files with 335 additions and 271 deletions

View File

@@ -54,7 +54,12 @@ func ParsePacketHeader(data []byte) (pbytes PacketBytes, err error) {
}
return
}
crc := algo.MD5Hash8(data[:PacketHeadNoCRCLen])
var crc uint64
pbuf.NewBytes(int(PacketHeadNoCRCLen)).V(func(b []byte) {
copy(b, data[:PacketHeadNoCRCLen])
ClearTTL(b)
crc = algo.MD5Hash8(b)
})
if crc != uint64(pb.DAT.md5h8rem) {
err = ErrBadCRCChecksum
if config.ShowDebugLog {