INNER CODE UNIT · Python

get_uid_from_str

allenai/objaverse-xl · objaverse/utils.py:8

def get_uid_from_str(string: str) -> str:
    """Generates a UUID from a string.

    Args:
        string (str): String to generate a UUID from.

    Returns:
        str: UUID generated from the string.
    """
    namespace = uuid.NAMESPACE_DNS
    return str(uuid.uuid5(namespace, string))


def get_file_hash(file_path: str) -> str:
    """Get the sha256 hash of a file.

    Args:
        file_path (str): Path to the file.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…