code: private static MessageDigest getDigest(String algorithm) {
          try {
              return MessageDigest.getInstance(algorithm);
          } catch (NoSuchAlgorithmException ex) {
              throw new IllegalStateException("Could not find MessageDigest with algorithm \"" + algorithm + "\"", ex);
          }
      }
docs: Create a new {@link MessageDigest} with the given algorithm. Necessary because {@code MessageDigest} is not
  thread-safe.