original_string: protected static function makeBin($str, $len)
      {
          if ($str instanceof self) {
              return $str->bytes;
          }
          if (\strlen($str) === $len) {
              return $str;
          }
  
          $str = (string)preg_replace([
              // strip URN scheme and namespace
              '/^urn:uuid:/is',
              // strip non-hex characters
              '/[^a-f0-9]/is',
          ], '', $str);
  
          if (\strlen($str) !== ($len * 2)) {
              return null;
          }
  
          return pack('H*', $str);
      }
code: protected static function makeBin($str, $len)
      {
          if ($str instanceof self) {
              return $str->bytes;
          }
          if (\strlen($str) === $len) {
              return $str;
          }
  
          $str = (string)preg_replace([
              // strip URN scheme and namespace
              '/^urn:uuid:/is',
              // strip non-hex characters
              '/[^a-f0-9]/is',
          ], '', $str);
  
          if (\strlen($str) !== ($len * 2)) {
              return null;
          }
  
          return pack('H*', $str);
      }
code_tokens: protected static function makeBin ( $ str , $ len ) { if ( $ str instanceof self ) { return $ str -> bytes ; } if ( \ strlen ( $ str ) === $ len ) { return $ str ; } $ str = ( string ) preg_replace ( [ // strip URN scheme and namespace '/^urn:uuid:/is' , // strip non-hex characters '/[^a-f0-9]/is' , ] , '' , $ str ) ; if ( \ strlen ( $ str ) !== ( $ len * 2 ) ) { return null ; } return pack ( 'H*' , $ str ) ; }
docstring: Insure that an input string is either binary or hexadecimal.
  Returns binary representation, or false on failure.
  
  @param string $str
  @param integer $len
  @return string|null
docstring_tokens: Insure that an input string is either binary or hexadecimal . Returns binary representation or false on failure .