def parse_sha256sum_file(filename):
    """
    Takes a SHA256 checksum file and returns the values as a dict

    :param filename: The file with SHA256 checksums
    :return Mapping: Check sums from file
    """
    with open(filename, 'r') as file:
        string = file.read()
    string = string.rstrip()
    # Parse file into a dictionary, the file format is
    # shasum  filename\nshasum1  filename1\n...
    tmp_dict = dict(item.split("  ") for item in string.split("\n"))
    # Swap keys and values
    sha256sums = dict((v, k) for k, v in tmp_dict.items())
    return sha256sums