code: private static MessageDigest getMessageDigest(String algorithm) {
          try {
              return MessageDigest.getInstance(algorithm);
          } catch (NoSuchAlgorithmException e) {
              LOGGER.error(e.getMessage());
              final String msg = String.format("Failed to obtain the %s message digest.", algorithm);
              throw new IllegalStateException(msg, e);
          }
      }
docs: Returns the message digest.
  
  @param algorithm the algorithm for the message digest
  @return the message digest