core-bundle/src/Resources/contao/library/Contao/Dbafs.php
public static function getFolderHash($strPath)
	{
		$strPath = str_replace(array('\\', '%', '_'), array('\\\\', '\\%', '\\_'), $strPath);
		$arrHash = array();

		$objChildren = Database::getInstance()
			->prepare("SELECT hash, name FROM tl_files WHERE path LIKE ? AND path NOT LIKE ? ORDER BY name")
			->execute($strPath.'/%', $strPath.'/%/%')
		;

		if ($objChildren !== null)
		{
			while ($objChildren->next())
			{
				$arrHash[] = $objChildren->hash . $objChildren->name;
			}
		}

		return md5(implode("\0", $arrHash));
	}
public static function getFolderHash($strPath)
	{
		$strPath = str_replace(array('\\', '%', '_'), array('\\\\', '\\%', '\\_'), $strPath);
		$arrHash = array();

		$objChildren = Database::getInstance()
			->prepare("SELECT hash, name FROM tl_files WHERE path LIKE ? AND path NOT LIKE ? ORDER BY name")
			->execute($strPath.'/%', $strPath.'/%/%')
		;

		if ($objChildren !== null)
		{
			while ($objChildren->next())
			{
				$arrHash[] = $objChildren->hash . $objChildren->name;
			}
		}

		return md5(implode("\0", $arrHash));
	}
Get the folder hash from the databse by combining the hashes of all children

@param string $strPath The relative path

@return string MD5 hash