An algorithm is given for the computation of moments of fS, where S is either a principal h-shift invariant space or S is a finitely generated h-shift invariant space. An error estimate for the rate of convergence of our scheme is also presented. In so doing, we obtain a result for computing inner products in these spaces. As corollaries, we derive Marsden-type identities for principal h-shift invariant spaces and finitely generated h-shift invariant spaces. Applications to wavelet/multiwavelet spaces are presented.