mirror of
https://github.com/sstent/go-garminconnect.git
synced 2026-03-01 18:45:42 +00:00
sync
This commit is contained in:
21
internal/fit/validator.go
Normal file
21
internal/fit/validator.go
Normal file
@@ -0,0 +1,21 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user