import hashlib


def _convert_to_id(name):
    """Convert a string to a suitable form for html attributes and ids."""
    hasher = hashlib.md5()
    hasher.update(name.encode('utf-8'))
    return hasher.hexdigest()