• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/crypt.php
  • Класс: CSteganos
  • Вызов: CSteganos::__ShowData
function __ShowData()
{
	if ($this->containerType == "bmp")
	{
		$nBytes = (($this->level == 1) ? 8 : (($this->level == 2) ? 4 : 2));

		$this->data = "";
		for ($i = 0; $i < $this->dataSize; $i++)
			$this->data = chr(0);

		for ($i = $this->offset, $j = 0; $i < $this->offset + $this->dataSize * $nBytes; $i += $nBytes, $j++)
		{
			if ($this->level == 1)
			{
				for ($k = 0, $n = 7; $k < 8; $k++, $n--)
					$this->data[$j] = chr(ord($this->data[$j]) | ((ord($this->containerData[$i + $k]) & 1) << $n));
			}
			elseif ($this->level == 2)
			{
				for ($k = 0, $n = 6; $k < 4; $k++, $n -= 2)
					$this->data[$j] = chr(ord($this->data[$j]) | ((ord($this->containerData[$i + $k]) & 3) << $n));
			}
			elseif ($this->level == 4)
			{
				for ($k = 0; $k < 2; $k++)
				{
					if ($k == 0)
						$this->data[$j] = chr(ord($this->data[$j]) | ((ord($this->containerData[$i]) & 15) << 4));
					else
						$this->data[$j] = chr(ord($this->data[$j]) | (ord($this->containerData[$i + 1]) & 15));
				}
			}
		}
	}
	elseif ($this->containerType == "txt")
	{
		$data = mb_substr($this->containerData, $this->offset, $this->dataSize);
		$this->data = $this->__ConvertBitStringToBinary($data);
	}
}