code: private static MessageDigest getMessageDigest(String digestType) {
          MessageDigest messageDigest;
          try {
              messageDigest = MessageDigest.getInstance(digestType);
          } catch (NoSuchAlgorithmException e) {
              //should not happen
              throw new RuntimeException(e);
          }
          return messageDigest;
      }
docs: this code replaces the creation of the message digest in a static code block
  as that was found to fail when multi threaded.
  
  @param digestType - MD5 or SHA-256
  @return the MessageDigest of the requested type