import functools
import operator


def compute_check(msg):
    """ Compute the check value for a message

    AUCTUS messages use a check byte which is simply the XOR of all
    the values of the message.

    """

    if len(msg) == 0:
        return 0
    return functools.reduce(operator.xor, msg)