1
0
mirror of https://github.com/garraflavatra/go-fmp.git synced 2025-07-18 03:54:05 +00:00

Add NewSector function

This commit is contained in:
2025-06-22 20:08:53 +02:00
parent 4ab7f0a588
commit c08c429b99
5 changed files with 71 additions and 9 deletions

View File

@ -24,3 +24,18 @@ func decodeString(payload []byte) string {
}
return result
}
func encodeUint(size uint, value int) []byte {
result := make([]byte, size)
for i := range size {
result[i] = byte(value & 0xFF)
value >>= 8
}
return result
}
func writeToSlice(slice []byte, start int, payload ...byte) {
for i := range payload {
slice[start+i] = payload[i]
}
}