title: How can I convert a md5 hash to an integral type in Java?
body: <p>I am trying to convert a md5 hash to a <code>long</code> like I can in python,</p>
  
  <blockquote>
  <pre><code>&gt;&gt;&gt; int(hashlib.md5("abc").hexdigest(),16) 
  191415658344158766168031473277922803570L 
  </code></pre>
  </blockquote>
  
  <p>When I digest "abc", I get (in Hex): "0X900150983CD24FB0D6963F7D28E17F72"</p>
  
  <p>What is the correct way to do this hash conversion in Java?</p>
  
  <pre><code>public static void main(String[] args) {
      byte[] md5hex = DigestUtils.md5("abc");
      String hex = new String(Hex.encodeHex(md5hex));
      System.out.println(hex);
      long lv = Long.parseLong("0X" + hex.toUpperCase(), 16);
      System.out.println(lv);
      int hext = Integer.parseInt("12346789", 16);
      System.out.println(hext);
  }
  </code></pre>