package s19 import "strconv" func validateChecksum(line string, checksum byte) bool { sum := byte(0) for i := 2; i < len(line)-2; i += 2 { value, _ := strconv.ParseUint(line[i:i+2], 16, 8) sum += byte(value) } return ^sum == checksum }