LdapTools\Utilities\TSProperty::getNibbleWithControl PHP Метод

getNibbleWithControl() защищенный Метод

If the nibble dec is <= 9, the control X equals 001011 and Y equals 001110, otherwise if the nibble dec is > 9 the control for X or Y equals 011010. Additionally, if the dec value of the nibble is > 9, then the nibble value must be subtracted by 9 before the final value is constructed.
protected getNibbleWithControl ( string $nibbleType, $nibble ) : string
$nibbleType string Either X or Y
$nibble
Результат string
    protected function getNibbleWithControl($nibbleType, $nibble)
    {
        $dec = bindec($nibble);
        if ($dec > 9) {
            $dec -= 9;
            $control = self::NIBBLE_CONTROL[$nibbleType][1];
        } else {
            $control = self::NIBBLE_CONTROL[$nibbleType][0];
        }
        return $control . sprintf('%04d', decbin($dec));
    }