import hashlib
def create_sha256_hash(input_string): # Create a SHA-256 hash object hash_object = hashlib.sha256() # Convert the string to bytes and update the hash object hash_object.update(input_string.encode('utf-8')) # Get the hexadecimal representation of the hash hash_hex = hash_object.hexdigest() return hash_hex
# Example usage input_str = "Hello, World!" print(create_sha256_hash(input_str))