code: public static DataHash hash(HashAlgorithm hashAlgorithm, byte[] left, byte[] right, long level) throws HashException {
          DataHasher hasher = new DataHasher(hashAlgorithm);
          hasher.addData(left).addData(right);
          hasher.addData(com.guardtime.ksi.util.Util.encodeUnsignedLong(level));
          return hasher.getHash();
      }
docs: Calculates a data hash using the following formula: H(left||right||Util.encodeUnsignedLong(level)) where
  H is a cryptographic hash function defined by {@code hashAlgorithm}.