code: public static byte[] SHA256(byte[] data) {
          Digest sha256 = createSHA256();
          sha256.update(data, 0, data.length);
          byte[] res = new byte[32];
          sha256.doFinal(res, 0);
          return res;
      }
docs: Calculating SHA256
  
  @param data source data
  @return SHA256 of data