def unpad(data):
    """ Unpads data previously padded with `pad`.

    Args:
        data: The data to remove padding from. Must be a `bytearray`. If not previously padded, data may be lost.
    """
    n = data[-1]
    del data[-n:]
