src/POData/Providers/Metadata/Type/Binary.php
/**
     * Checks a value is binary
     * 
     * @param string $value     value to check in base64 form
     * @param string &$outValue Processed value 
     * 
     * @return boolean
     */
Checks a value is binary

@param string $value     value to check in base64 form
@param string &$outValue Processed value

@return boolean
Checks a value is binary @param string $value value to check in base64 form @param string &$outValue Processed value @return boolean
public static function validateWithoutPrefix($value, &$outValue)
    {
        $length = strlen($value);
        if ($length == 0 || $length%2 != 0) {
            return false;    
        }
	    if (!ctype_xdigit($value)){
		    $outValue = null;
		    return false;
	    }
        $outValue = array();
        $outValIndex = 0;
        $valueIndex = 0;
        while ($valueIndex < $length) {
            $ch0 = $value[$valueIndex];
            $ch1 = $value[$valueIndex + 1];
            $outValue[$outValIndex] = hexdec($ch0) << 4 + hexdec($ch1);
            $valueIndex += 2;
            $outValIndex++;
        }
        return true;
    }
public static function validateWithoutPrefix ( $ value , & $ outValue ) { $ length = strlen ( $ value ) ; if ( $ length == 0 || $ length % 2 != 0 ) { return false ; } if ( ! ctype_xdigit ( $ value ) ) { $ outValue = null ; return false ; } $ outValue = array ( ) ; $ outValIndex = 0 ; $ valueIndex = 0 ; while ( $ valueIndex < $ length ) { $ ch0 = $ value [ $ valueIndex ] ; $ ch1 = $ value [ $ valueIndex + 1 ] ; $ outValue [ $ outValIndex ] = hexdec ( $ ch0 ) << 4 + hexdec ( $ ch1 ) ; $ valueIndex += 2 ; $ outValIndex ++ ; } return true ; }
Checks a value is binary
Checks a value is binary