def _Checksum(sentence):
  """Compute the NMEA checksum for a payload."""
  checksum = 0
  for char in sentence:
    checksum ^= ord(char)
  checksum_str = '%02x' % checksum
  return checksum_str.upper()