def shortened_hash(s, n):
    """ Return a shortened string with the first and last bits of a hash
    :param s: the full string to shorten
    :param n: the desired length of the string returned
    :return: An n-character string with the first and last bits of s
    """
    side_len = int((n - 3) / 2)
    if len(s) <= n:
        return s
    else:
        return s[0:side_len] + "..." + s[(-1 * side_len):]