import hashlib


def md5(string):
    """
    Encrypt a string with MD5, used for password and Gravatar.

        >>> md5('')
        'd41d8cd98f00b204e9800998ecf8427e'
        >>> md5('admin')
        '21232f297a57a5a743894a0e4a801fc3'
    """
    string = string.encode('UTF-8')
    return hashlib.md5(string).hexdigest()