• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/crypt.php
  • Класс: CSteganos
  • Вызов: CSteganos::__CheckContainer
function __CheckContainer()
{
	if ($this->containerType == "bmp")
	{
		if ($this->level < 1 || $this->level > 4)
		{
			$this->errorMessage = "The encryption level is out of range";
			return false;
		}

		$containerSize = filesize($this->containerFile);
		$this->dataSize = mb_strlen($this->data);
		$totalSize = (12 + $this->dataSize) * (ceil(8 / $this->level));
		if (($containerSize - 55) < $totalSize)
		{
			$this->errorMessage = "The bitmap file '".$this->containerFile."' is too small to carry the input data";
			return false;
		}
	}
	return true;
}