1
0
mirror of https://github.com/garraflavatra/go-fmp.git synced 2025-06-28 04:25:11 +00:00
This commit is contained in:
2025-06-12 21:21:55 +02:00
parent f72d9510d4
commit 7fa7a3787d
7 changed files with 83 additions and 71 deletions

View File

@ -2,10 +2,7 @@ package fmp
func parseVarUint64(payload []byte) uint64 {
var length uint64
n := len(payload)
if n > 8 {
n = 8 // clamp to max uint64
}
n := min(len(payload), 8) // clamp to uint64
for i := range n {
length <<= 8
length |= uint64(payload[i])