def _checksum(packet):
    """
    Calculate the packet's checksum

    :param packet: The packet to check
    :type packet: bytes

    :rtype: int
    """
    chk = packet[0] + packet[1] - sum(packet[2:12])
    if chk < 0:
        chk = 256 + chk # Hmm hmm hmm

    return chk