Created
September 5, 2016 20:16
-
-
Save devendranaga/41eccd695e48847bfc9c205b7b3669bd to your computer and use it in GitHub Desktop.
nmea checksum calculator in Golang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func nmea0183_checksum(nmea_in string) int { | |
check_sum:= 0 | |
nmea_data := []byte(nmea_in) | |
for i:= 1; i < len(nmea_in) - 3; i ++ { | |
check_sum ^= (int)(nmea_data[i]) | |
} | |
return check_sum; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment