1
0
mirror of https://github.com/garraflavatra/go-fmp.git synced 2025-06-28 12:35:12 +00:00
Files
go-fmp/fmp/fmp_util.go

20 lines
352 B
Go
Raw Normal View History

2025-06-12 11:44:57 +02:00
package fmp
func parseVarUint64(payload []byte) uint64 {
var length uint64
2025-06-12 21:21:55 +02:00
n := min(len(payload), 8) // clamp to uint64
2025-06-12 11:44:57 +02:00
for i := range n {
length <<= 8
length |= uint64(payload[i])
2025-06-12 11:44:57 +02:00
}
return length
}
func decodeByteSeq(payload []byte) string {
result := ""
for i := range payload {
result += string(payload[i] ^ 0x5A)
}
return result
}