code: static String md5(String input) {
      if (input == null || input.length() == 0) {
        throw new IllegalArgumentException("Input string must not be blank.");
      }
      try {
        MessageDigest algorithm = MessageDigest.getInstance("MD5");
        algorithm.reset();
        algorithm.update(input.getBytes());
        byte[] messageDigest = algorithm.digest();
  
        StringBuilder hexString = new StringBuilder();
        for (byte messageByte : messageDigest) {
          hexString.append(Integer.toHexString((messageByte & 0xFF) | 0x100).substring(1, 3));
        }
        return hexString.toString();
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
docs: Create an MD5 hash of a string.
  
  @param input Input string.
  @return Hash of input.
  @throws IllegalArgumentException if {@code input} is blank.