def hash_with_sha512(string): hash = hashlib.sha512() string = string.encode('utf-8') hash.update(string) return hash