this is the sub
'An NMEA checksum is calculated as the XOR of bytes between (but not including) the dollar sign and asterisk.
Sub NMEA_Checksum(sentence As String) As String
Dim s As String
Dim i As Int
Dim sum(1) As Byte
'Log("NMEA passed:" & sentence)
s = sentence.Trim
sum(0)=0
For i = 0 To s.Length-1
sum(0) = Bit.Xor(sum(0),Asc(s.SubString2(i,i+1)))
Next
'debug.print "Chk=";CstrHex(sum)
Return conv.HexFromBytes(sum)
End Sub
the name is right - i cut and paste. was zbasic code once upon a time