def int_to_8byte(i):
    """Given an integer, return a bytearray of its unsigned integer
    representation, big-endian.
    """
    return bytearray([i >> 56 & 255, i >> 48 & 255, i >> 40 & 255, i >> 32 &
        255, i >> 24 & 255, i >> 16 & 255, i >> 8 & 255, i & 255])
