from pathlib import Path
from typing import Callable


def get_hash(req_path: Path, algorithm: Callable) -> str:
    """
    Calculate hash value for `req_path` file using `algorithm`.

    :param req_path: of which file to calculate hash
    :param algorithm: hash algorithm to be used
    :returns: calculated hash value, "-1" if file not found
    """
    try:
        with open(req_path, mode='rb') as req_file:
            hashgen = algorithm()
            hashgen.update(req_file.read())
            return hashgen.hexdigest()
    except FileNotFoundError:
        return "-1"