Public Member Functions | |
to_bin ($value) | |
to_hex ($value) | |
is_hexbin ($value) |
Definition at line 22 of file class.ilBMFType_hexBinary.php.
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; }
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); }
ilBMFType_hexBinary::to_hex | ( | $ | value | ) |
Definition at line 29 of file class.ilBMFType_hexBinary.php.
Referenced by is_hexbin().
{
return bin2hex($value);
}