Write a python function to check if SHA256 hashed value is valid for given data or not


Topic: Write a python function to check if SHA256 hashed value is valid for given data or not

Solution

def check_sha256_hash(hashed, data):
    import hashlib
    return True if hashed == hashlib.sha256(data.encode()).hexdigest() else False



List all Python Programs