original_string: public static function fromHex($hex)
    {
      $string = "";
  
      if(strlen($hex)%2 == 1)
      {
        throw new Exception("given parameter '" . $hex . "' is not a valid hexadecimal number");
      }
  
      foreach(str_split($hex, 2) as $chunk)
      {
        $string .= chr(hexdec($chunk));
      }
  
      return new self($string);
    }
code: public static function fromHex($hex)
    {
      $string = "";
  
      if(strlen($hex)%2 == 1)
      {
        throw new Exception("given parameter '" . $hex . "' is not a valid hexadecimal number");
      }
  
      foreach(str_split($hex, 2) as $chunk)
      {
        $string .= chr(hexdec($chunk));
      }
  
      return new self($string);
    }
code_tokens: public static function fromHex ( $ hex ) { $ string = "" ; if ( strlen ( $ hex ) % 2 == 1 ) { throw new Exception ( "given parameter '" . $ hex . "' is not a valid hexadecimal number" ) ; } foreach ( str_split ( $ hex , 2 ) as $ chunk ) { $ string .= chr ( hexdec ( $ chunk ) ) ; } return new self ( $ string ) ; }
docstring: Returns the Str based on a given hex value.
  
  @param  string $hex
  @throws Exception
  @return Str
docstring_tokens: Returns the Str based on a given hex value .