import hashlib
import uuid


def generate_uuid_based_on_str(string: str) -> str:
    """Generates a UUID based on a string.

    Args:
        string: string to base the UUID generation on

    Returns:
        a UUID
    """
    m = hashlib.md5()
    m.update((string if string else "").encode("utf-8"))
    return str(uuid.UUID(m.hexdigest()))