code: public static byte[] computeSha256(final byte[] data) {
          try {
              return MessageDigest.getInstance(ALGORITHM_SHA_256).digest(data);
          } catch (NoSuchAlgorithmException e) {
              throw new IllegalStateException("unsupported algorithm for message digest: ", e);
          }
      }
docs: Calculate the message digest value with SHA 256 algorithm.
  @param data to calculate.
  @return message digest value.