INNER CODE UNIT · Python

string2md5

junruxiong/IncarnaMind · docs2db.py:60

def string2md5(text: str):
    """Convert a string to its MD5 hash.

    Args:
        text (str): The text to be hashed.

    Returns:
        str: The MD5 hash of the input string.
    """
    hash_md5 = hashlib.md5()
    hash_md5.update(text.encode("utf-8"))

    return hash_md5.hexdigest()


def load_file(file_path):
    """Load a file and return its content as a Document object.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…