title: Convert IP address in String format to Hex in Groovy
body: <p>I want to convert an IP address in String format, "1.2.3.4", to this hex format: 0x01020304. </p>
  
  <p>When using InetAddress.getByName, it also adds Address-Type bits, which I don't want.</p>
  
  <p>Is there any other method I can use for this? </p>
  
  <p>Otherwise, I thought about manually tokenize the String as follows:</p>
  
  <pre><code>def digitsList = "1.2.3.4".tokenize('.');
  </code></pre>
  
  <p>But then I don't know how to proceed from there to lay the digits on the desired hex format.</p>