title: MD5 hash is different
body: <p>I don't know how to realize these few lines from php to java..</p>
  
  <pre><code>$varInHex = "\x22\x33\xAd\xB5\x2b\xE6\x22\x33\x12\x36\x22\x31\xCA\x22\x11\x41\x62\x21\x22\x01\x55\x22\x71\x42\x10\x36";&lt;br/&gt;&lt;br/&gt;
  $result = md5($varInHex);
  echo $result;
  </code></pre>
  
  <p>Well, I tried to convert it but I'm getting a different result!</p>
  
  <pre><code>byte[] seq20 = new byte[]{(byte)0x22,(byte)...etc...};
  String str = seq20.toString();
  String result = md5(str);
  System.out.println(result);
  
  public static String md5(String source) {
      try {
          MessageDigest md = MessageDigest.getInstance("MD5");
          byte[] bytes = md.digest(source.getBytes("UTF-8"));
          return getString(bytes);
      } catch (Exception e) {
          e.printStackTrace();
          return null;
      }
  }
  
  private static String getString(byte[] bytes) {
      StringBuffer sb = new StringBuffer();
      for (int i = 0; i &lt; bytes.length; i++) {
          byte b = bytes[i];
          String hex = Integer.toHexString((int) 0x00FF &amp; b);
          if (hex.length() == 1) {
              sb.append("0");
          }
          sb.append(hex);
      }
      return sb.toString();
  }
  </code></pre>
  
  <p>result in java is different from result in php..</p>
  
  <p>Can you help me please??
  Thank you in advance :)</p>