def calculate_crc(nmea_partial_sentence):
    """
    Calculate the CRC of a NMEA sentence, CRC is a simple XOR of all values between $ and *
    """

    # Reset to zero
    calculated_checksum = 0
    # Go through each character and XOR, create an integer
    for character in nmea_partial_sentence:
        calculated_checksum ^= ord(character)
    # Convert to hex, 2 digits
    calculated_checksum_2_digits = format(calculated_checksum, '02X')
    return calculated_checksum_2_digits