# Path: lib/jhash.py
# def string_to_md5(content):
#     """Calculate the md5 hash of a string.
# 
#     This 'string' can be the binary content of a file too."""
#     content = content.encode("utf8")
#     return hashlib.md5(content).hexdigest()


import readline    # to overcome the 4k input limit
from lib.jhash import string_to_md5
#!/usr/bin/env python3

"""
Convert a text (string) to md5 hexa string (encode).
"""




def main():
    try:
        text = input("text> ")
    except (KeyboardInterrupt, EOFError):
        print()
        return
    #
    print("Text: '{}'".format(text))
    print()

# Path: lib/jhash.py
# def string_to_md5(content):
#     """Calculate the md5 hash of a string.
# 
#     This 'string' can be the binary content of a file too."""
#     content = content.encode("utf8")
#     return hashlib.md5(content).hexdigest()


# Path: to_md5.py
import readline    # to overcome the 4k input limit
from lib.jhash import string_to_md5

#!/usr/bin/env python3

"""
Convert a text (string) to md5 hexa string (encode).
"""




def main():
    try:
        text = input("text> ")
    except (KeyboardInterrupt, EOFError):
        print()
        return
    #
    print("Text: '{}'".format(text))
    print()

    print(string_to_md5(text))