def hash_string(string, hash_type=hashlib.md5):

    hash_state = hash_type()

    hash_state.update(string)

    return hash_state.hexdigest()
Hashes the given string with the desired type, defaults to MD5.
dataset/ETHPy150Open jlisee/xpkg/python/xpkg/util.py/hash_string