import hashlib


def check_password(password, salt, hashed_password):
    """Hashes the password the user provides and checks it against the stored hash.
    :param password: Password user provides.
    :param salt: Salt stored in users file.
    :param hashed_password: Hashed password stored in users file.
    :returns: True if password provided is correct, else False."""
    password = password.encode("utf-8")  # Encode the input correctly.
    return hashlib.sha256(salt + password).hexdigest() == hashed_password