mirror of
https://github.com/sstent/go-garminconnect.git
synced 2026-01-27 01:21:36 +00:00
22 lines
395 B
Go
22 lines
395 B
Go
package fit
|
|
|
|
// Validate performs basic validation of FIT file structure
|
|
func Validate(data []byte) bool {
|
|
// Minimum FIT file size is 14 bytes (header)
|
|
if len(data) < 14 {
|
|
return false
|
|
}
|
|
|
|
// Check magic number: ".FIT"
|
|
if string(data[8:12]) != ".FIT" {
|
|
return false
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
// MinFileSize returns the minimum size of a valid FIT file
|
|
func MinFileSize() int {
|
|
return 14
|
|
}
|