import struct


def pack_timestamp_resolution(base, exponent):
    """
    Pack a timestamp resolution.

    :param base: 2 or 10
    :param exponent: negative power of the base to be encoded
    """
    exponent = abs(exponent)
    if base == 2:
        return struct.pack('B', exponent | 0b10000000)
    if base == 10:
        return struct.pack('B', exponent)
    raise ValueError('Supported bases are: 2, 10')