import hashlib


def hash_string(in_str, hash_len=6):
    """Create a hash string based on input string

    Arguments:
        in_str (str): input string
        hash_len (int): length of returned hex hash string

    Returns:
        (str): hex ([0-9a-f]+) string of length hash_len, corresponding to hash
            of in_str
    """
    model_hash = hashlib.md5(in_str.encode('utf8'))
    return model_hash.hexdigest()[:hash_len]