private function validateHash(FileIDHelper $helper, ParsedFileID $parsedFileID, Filesystem $filesystem)
    {
        // We assumme that hashless parsed file ID are always valid
        if (!$parsedFileID->getHash()) {
            return true;
        }

        // Check if the physical hash of the file starts with our parsed file ID hash
        $actualHash = $this->findHashOf($helper, $parsedFileID, $filesystem);
        return strpos($actualHash, $parsedFileID->getHash()) === 0;
    }
private function validateHash(FileIDHelper $helper, ParsedFileID $parsedFileID, Filesystem $filesystem)
    {
        // We assumme that hashless parsed file ID are always valid
        if (!$parsedFileID->getHash()) {
            return true;
        }

        // Check if the physical hash of the file starts with our parsed file ID hash
        $actualHash = $this->findHashOf($helper, $parsedFileID, $filesystem);
        return strpos($actualHash, $parsedFileID->getHash()) === 0;
    }
private function validateHash ( FileIDHelper $ helper , ParsedFileID $ parsedFileID , Filesystem $ filesystem ) { // We assumme that hashless parsed file ID are always valid if ( ! $ parsedFileID -> getHash ( ) ) { return true ; } // Check if the physical hash of the file starts with our parsed file ID hash $ actualHash = $ this -> findHashOf ( $ helper , $ parsedFileID , $ filesystem ) ; return strpos ( $ actualHash , $ parsedFileID -> getHash ( ) ) === 0 ; }
Try to validate the hash of a physical file against the expected hash from the parsed file ID.
@param FileIDHelper $helper
@param ParsedFileID $parsedFileID
@param Filesystem $filesystem
@return bool
Try to validate the hash of a physical file against the expected hash from the parsed file ID .