• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/manager.php
  • Класс: BitrixLandingManager
  • Вызов: Manager::calculateHash
static function calculateHash(string $filePath, int $size): string
{
	$hash = '';

	if ($size > 0 && Option::get('main', 'control_file_duplicates', 'N') === 'Y')
	{
		$maxSize = (int)Option::get('main', 'duplicates_max_size', '100') * 1024 * 1024; //Mbytes
		if ($size <= $maxSize || $maxSize === 0)
		{
			$hash = hash_file('md5', $filePath);
		}
	}

	return $hash;
}