• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/itemexport.php
  • Класс: Bitrix\Crm\Controller\ItemExport
  • Вызов: ItemExport::generateExportFileName
protected function generateExportFileName(): string
{
	if ($this->exportType === self::EXPORT_TYPE_CSV)
	{
		$fileExt = 'csv';
	}
	elseif ($this->exportType === self::EXPORT_TYPE_EXCEL)
	{
		$fileExt = 'xls';
	}

	$prefix = $this->entityTypeId . '_' . date('Ymd');
	$hash = str_pad(dechex(crc32($prefix)), 8, '0', STR_PAD_LEFT);

	return uniqid($prefix . '_' . $hash . '_', false) . '.' . $fileExt;
}