model/utils.py
def verify_hash(content: dict, hashing: str) -> bool:
    """Verifies if the hash is valid"""

    encoded_content = json.dumps(content, sort_keys=True).encode()
    hash_value = hashlib.sha256(encoded_content).hexdigest()

    return hash_value == hashing
Verifies if the hash is valid
Verifies if the hash is valid
Verifies if the hash is valid
def verify_hash(content: dict, hashing: str) -> bool:
    encoded_content = json.dumps(content, sort_keys=True).encode()
    hash_value = hashlib.sha256(encoded_content).hexdigest()
    return hash_value == hashing
def verify_hash ( content : dict , hashing : str ) -> bool : encoded_content = json . dumps ( content , sort_keys = True ) . encode ( ) hash_value = hashlib . sha256 ( encoded_content ) . hexdigest ( ) return hash_value == hashing
Verifies if the hash is valid
Verifies if the hash is valid
"""Verifies if the hash is valid"""
content
dict
hashing
str