title: Current way of generating MD5 hash (Java 8/9)
body: <p>Working on an old java project that generates MD5 hash strings got me wondering about the current state of things.</p>
  
  <p>Is there a good way to create such hash using current technologies?  Maybe some new libraries for Java 8/9?</p>
  
  <p>The way I generated MD5 hash before was:</p>
  
  <pre><code> import java.security.*;
   import java.math.*;
  
   public class MD5 {
      public static void main(String args[]) throws Exception{
         String s="This is a test";
         MessageDigest m=MessageDigest.getInstance("MD5");
         m.update(s.getBytes(),0,s.length());
         System.out.println("MD5: "+new BigInteger(1,m.digest()).toString(16));
     }
  }
  </code></pre>
  
  <p>Thanks.</p>