• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/file.php
  • Класс: CFile
  • Вызов: CFile::CalculateHash
static function CalculateHash($file, $size)
{
	$hash = '';
	if ($size > 0 && COption::GetOptionString('main', 'control_file_duplicates', 'N') === 'Y')
	{
		$maxSize = (int)COption::GetOptionString('main', 'duplicates_max_size', '100') * 1024 * 1024; //Mbytes
		if($size <= $maxSize || $maxSize === 0)
		{
			$hash = hash_file("md5", $file);
		}
	}
	return $hash;
}