• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/rsabcmath.php
  • Класс: CRsaBcmathProvider
  • Вызов: CRsaBcmathProvider::bitlenght
static function bitlenght($in)
{
	$t = self::int2raw($in);
	$out = mb_strlen($t) * 8;

	$t = ord($t[mb_strlen($t) - 1]);

	if(!$t) 
	{
		$out -= 8;
	}
	else 
	{
		while(!($t & 0x80)) 
		{
			$out--;
			$t <<= 1;
		}
	}
	return $out;
}