ILIAS  release_4-4 Revision
ilBMFType_hexBinary Class Reference
+ Collaboration diagram for ilBMFType_hexBinary:

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

◆ is_hexbin()

ilBMFType_hexBinary::is_hexbin (   $value)

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

References to_bin(), and to_hex().

Referenced by ilBMFBase\_getType().

34  {
35  # first see if there are any invalid chars
36  $l = strlen($value);
37 
38  if ($l < 1 || strspn($value, '0123456789ABCDEFabcdef') != $l) return FALSE;
39 
40  $bin = ilBMFType_hexBinary::to_bin($value);
41  $hex = ilBMFType_hexBinary::to_hex($bin);
42  return strcasecmp($value, $hex) == 0;
43  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ to_bin()

ilBMFType_hexBinary::to_bin (   $value)

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

Referenced by is_hexbin().

25  {
26  $len = strlen($value);
27  return pack('H' . $len, $value);
28  }
+ Here is the caller graph for this function:

◆ to_hex()

ilBMFType_hexBinary::to_hex (   $value)

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

Referenced by is_hexbin().

30  {
31  return bin2hex($value);
32  }
+ Here is the caller graph for this function:

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