Public Member Functions

ilBMFType_hexBinary Class Reference

Public Member Functions

 to_bin ($value)
 to_hex ($value)
 is_hexbin ($value)

Detailed Description

Definition at line 22 of file class.ilBMFType_hexBinary.php.


Member Function Documentation

ilBMFType_hexBinary::is_hexbin ( value  ) 

Definition at line 33 of file class.ilBMFType_hexBinary.php.

References to_bin(), and to_hex().

    {
        # first see if there are any invalid chars
        $l = strlen($value);

        if ($l < 1 || strspn($value, '0123456789ABCDEFabcdef') != $l) return FALSE;

        $bin = ilBMFType_hexBinary::to_bin($value);
        $hex = ilBMFType_hexBinary::to_hex($bin);
        return strcasecmp($value, $hex) == 0;
    }

Here is the call graph for this function:

ilBMFType_hexBinary::to_bin ( value  ) 

Definition at line 24 of file class.ilBMFType_hexBinary.php.

Referenced by is_hexbin().

    {
        $len = strlen($value);
        return pack('H' . $len, $value);
    }

Here is the caller graph for this function:

ilBMFType_hexBinary::to_hex ( value  ) 

Definition at line 29 of file class.ilBMFType_hexBinary.php.

Referenced by is_hexbin().

    {
        return bin2hex($value);
    }

Here is the caller graph for this function:


The documentation for this class was generated from the following file: