src/Classes/AdldapUtils.php
public function binaryToText($bin)
    {
        $hex_guid = bin2hex($bin);

        $hex_guid_to_guid_str = '';

        for ($k = 1; $k <= 4; ++$k) {
            $hex_guid_to_guid_str .= substr($hex_guid, 8 - 2 * $k, 2);
        }

        $hex_guid_to_guid_str .= '-';

        for ($k = 1; $k <= 2; ++$k) {
            $hex_guid_to_guid_str .= substr($hex_guid, 12 - 2 * $k, 2);
        }

        $hex_guid_to_guid_str .= '-';

        for ($k = 1; $k <= 2; ++$k) {
            $hex_guid_to_guid_str .= substr($hex_guid, 16 - 2 * $k, 2);
        }

        $hex_guid_to_guid_str .= '-'.substr($hex_guid, 16, 4);

        $hex_guid_to_guid_str .= '-'.substr($hex_guid, 20);

        return strtoupper($hex_guid_to_guid_str);
    }
public function binaryToText($bin)
    {
        $hex_guid = bin2hex($bin);

        $hex_guid_to_guid_str = '';

        for ($k = 1; $k <= 4; ++$k) {
            $hex_guid_to_guid_str .= substr($hex_guid, 8 - 2 * $k, 2);
        }

        $hex_guid_to_guid_str .= '-';

        for ($k = 1; $k <= 2; ++$k) {
            $hex_guid_to_guid_str .= substr($hex_guid, 12 - 2 * $k, 2);
        }

        $hex_guid_to_guid_str .= '-';

        for ($k = 1; $k <= 2; ++$k) {
            $hex_guid_to_guid_str .= substr($hex_guid, 16 - 2 * $k, 2);
        }

        $hex_guid_to_guid_str .= '-'.substr($hex_guid, 16, 4);

        $hex_guid_to_guid_str .= '-'.substr($hex_guid, 20);

        return strtoupper($hex_guid_to_guid_str);
    }
public function binaryToText ( $ bin ) { $ hex_guid = bin2hex ( $ bin ) ; $ hex_guid_to_guid_str = '' ; for ( $ k = 1 ; $ k <= 4 ; ++ $ k ) { $ hex_guid_to_guid_str .= substr ( $ hex_guid , 8 - 2 * $ k , 2 ) ; } $ hex_guid_to_guid_str .= '-' ; for ( $ k = 1 ; $ k <= 2 ; ++ $ k ) { $ hex_guid_to_guid_str .= substr ( $ hex_guid , 12 - 2 * $ k , 2 ) ; } $ hex_guid_to_guid_str .= '-' ; for ( $ k = 1 ; $ k <= 2 ; ++ $ k ) { $ hex_guid_to_guid_str .= substr ( $ hex_guid , 16 - 2 * $ k , 2 ) ; } $ hex_guid_to_guid_str .= '-' . substr ( $ hex_guid , 16 , 4 ) ; $ hex_guid_to_guid_str .= '-' . substr ( $ hex_guid , 20 ) ; return strtoupper ( $ hex_guid_to_guid_str ) ; }
Converts a binary attribute to a string.

@param string $bin A binary LDAP attribute

@return string
Converts a binary attribute to a string .