import hashlib


def md5_key_mangler(key):
    """Receive cache keys as long concatenated strings;
    distill them into an md5 hash.

    """
    d = hashlib.md5(key.encode('utf-8'))
    return d.hexdigest()